-
Notifications
You must be signed in to change notification settings - Fork 1
API.Service.Input
JuDelCo edited this page May 20, 2021
·
7 revisions
Namespaces: Ju.Services
& Ju.Input
This service provides a high level (players, actions) and a low level (direct access to raw data) input API.
IEnumerable<IInputPlayer> Players;
IMouseController Mouse;
IKeyboardController Keyboard;
IEnumerable<IGamepadController> Gamepads;
IEnumerable<IGamepadController> CustomControllers;
IInputPlayer AddPlayer(string playerId);
void RemovePlayer(IInputPlayer player);
void AddCustomController(IGamepadController controller);
void RemoveCustomController(IGamepadController controller);
bool IsAnyPressed();
string Id;
IEnumerable<IInputAction> Actions;
IEnumerable<IController> Controllers;
IInputAction AddAction(string actionId);
IInputAction GetAction(string actionId);
void RemoveAction(IInputAction action);
void BindController(IController controller);
void UnbindController(IController controller);
string Id;
IInputPlayer Player;
bool Enabled;
IEnumerable<MouseButton> MouseButtonBindings;
IEnumerable<KeyboardKey> KeyboardKeyBindings;
IEnumerable<GamepadButton> GamepadButtonBindings;
IEnumerable<GamepadAxis> GamepadAxisBindings;
void ResetBindings();
IInputAction AddBinding(MouseButton button);
IInputAction AddBinding(MouseButton positiveButton, MouseButton negativeButton);
IInputAction AddBinding(KeyboardKey key);
IInputAction AddBinding(KeyboardKey positiveKey, KeyboardKey negativeKey);
IInputAction AddBinding(GamepadButton button);
IInputAction AddBinding(GamepadButton positiveButton, GamepadButton negativeButton);
void RemoveBinding(MouseButton button);
void RemoveBinding(KeyboardKey key);
void RemoveBinding(GamepadButton button);
bool IsPressed();
bool IsHeld();
float HeldDuration();
bool IsReleased();
IInputAction AddBinding(GamepadAxis axis);
void RemoveBinding(GamepadAxis axis);
float GetAxisValue();
void GetAxisRawValue(out float axisX, out float axisY);
string Id;
void ResetState();
void CheckState(float deltaTime);
void Set(bool value);
void Set(float value);
void Set(float valueX, float valueY);
string Id;
bool IsAnyKeyPressed();
bool IsKeyPressed(KeyboardKey key);
bool IsKeyHeld(KeyboardKey key);
bool IsKeyReleased(KeyboardKey key);
KeyboardKey FirstPressedKey();
string GetInputString();
MouseLockMode LockMode;
bool Visible;
bool IsAnyButtonPressed();
bool IsButtonPressed(MouseButton button);
bool IsButtonHeld(MouseButton button);
bool IsButtonReleased(MouseButton button);
MouseButton FirstPressedButton();
void GetPosition(out int mouseX, out int mouseY);
void GetPositionDelta(out float mouseX, out float mouseY);
float GetWheelDelta();
bool Enabled;
float Deadzone;
bool IsAnyButtonPressed();
bool IsButtonPressed(GamepadButton button);
bool IsButtonPressed(GamepadButtonRaw button);
bool IsButtonHeld(GamepadButton button);
bool IsButtonHeld(GamepadButtonRaw button);
bool IsButtonReleased(GamepadButton button);
bool IsButtonReleased(GamepadButtonRaw button);
GamepadButton FirstPressedButton();
bool IsAnyAxisPressed();
float GetAxis(GamepadAxis axis);
float GetAxis(GamepadAxisRaw axis);
void GetAxisRaw(GamepadAxis axis, out float axisX, out float axisY);
GamepadAxis FirstPressedAxis();
Abstract virtual class, you can implement it to create custom virtual controllers.
InputGamepadConnectedEvent(IGamepadController controller);
InputGamepadDisconnectedEvent(IGamepadController controller);
InputActionPressedEvent(IInputAction action);
InputActionHeldEvent(IInputAction action);
InputActionReleased(IInputAction action);
Return to [Home]
- Home
- Install
- Manual
-
Core API
- Services:
- Util:
-
Unity API
- Services:
- Integrations: