Keyboard and mouse input handler. More...
Public Attributes | |
Key | Key |
Global Script Object to access the Input Key enumeration. | |
MouseButton | MouseButton |
Global Script Object to access the Input MouseButton enumeration. | |
Action | Action |
Global Script Object to access the Input Action enumeration. |
Low Level Methods | |
string | GetActionName (int action) |
Get the name assigned to the specified action. | |
int | GetKey (int action) |
Get the key code associated with the specified action. | |
int | GetKeyAction (int key) |
Get the action associated with the specified key. | |
string | GetKeyName (int key) |
Get the name of the specified key. | |
int | GetMouseButton (int action) |
Get the mouse button ID associated with the specified action. | |
int | GetMouseButtonAction (int mouseButton) |
Get the action associated with the specified mouse button. | |
string | GetMouseButtonName (int mouseButton) |
Get the name assigned to the specified mouse button. | |
int | GetJoystickAxisX (int joystick) |
Get the left-right movement of the specified joystick. | |
int | GetJoystickAxisY (int joystick) |
Get the forward-backward movement of the specified joystick. | |
int | GetJoystickAxisZ (int joystick) |
Checks z-axis (often the throttle control) of the specified joystick. | |
int | GetNumberOfJoysticks () |
Get the number of joysticks connected to the system. | |
bool | IsJoystickButtonDown (int joystick, int button) |
Get the state of the button with the ID button of the specified joystick. | |
bool | IsKeyDown (int key) |
Check if the specified key is pressed. | |
bool | IsMouseButtonDown (int mouseButton) |
Check if the specified mouse button is pressed. | |
int | KeyDown () |
Check if any key is pressed. | |
void | SetEnabled (bool pause) |
Pause or restore the keyboard control. | |
void | SetMousePosition (Point position) |
Set the current mouse cursor position. | |
Point | GetMousePosition () |
Return the current mouse cursor position as a pixel offset from the top-left corner of the display. |
Keyboard and mouse input handler.
string Input::GetActionName | ( | int | action | ) |
Get the name assigned to the specified action.
action | integer value specifying the action ID. |
int Input::GetKey | ( | int | action | ) |
Get the key code associated with the specified action.
action | integer value specifying the action ID. |
int Input::GetKeyAction | ( | int | key | ) |
Get the action associated with the specified key.
key | integer value specifying the key code. |
string Input::GetKeyName | ( | int | key | ) |
Get the name of the specified key.
key | integer value specifying the key code. |
int Input::GetMouseButton | ( | int | action | ) |
Get the mouse button ID associated with the specified action.
action | integer value specifying the action ID. |
int Input::GetMouseButtonAction | ( | int | mouseButton | ) |
Get the action associated with the specified mouse button.
mouseButton | integer value specifying the mouse button. |
string Input::GetMouseButtonName | ( | int | mouseButton | ) |
Get the name assigned to the specified mouse button.
mouseButton | integer value specifying the mouse button. |
int Input::GetJoystickAxisX | ( | int | joystick | ) |
Get the left-right movement of the specified joystick.
joystick | integer value used to identify the joystick (0 - max. 3). |
int Input::GetJoystickAxisY | ( | int | joystick | ) |
Get the forward-backward movement of the specified joystick.
joystick | integer value used to identify the joystick (0 - max. 3). |
int Input::GetJoystickAxisZ | ( | int | joystick | ) |
Checks z-axis (often the throttle control) of the specified joystick.
If the joystick does not have this axis, the value is 0.
joystick | integer value used to identify the joystick (0 - max. 3). |
int Input::GetNumberOfJoysticks | ( | ) |
Get the number of joysticks connected to the system.
bool Input::IsJoystickButtonDown | ( | int | joystick, |
int | button | ||
) |
Get the state of the button with the ID button of the specified joystick.
joystick | integer value used to identify the joystick (0 - max. 3). |
button | integer value used to identify the button of the joystick. |
bool Input::IsKeyDown | ( | int | key | ) |
Check if the specified key is pressed.
key | integer value specifying the key code to check. |
bool Input::IsMouseButtonDown | ( | int | mouseButton | ) |
Check if the specified mouse button is pressed.
mouseButton | integer value specifying the mouse button to check. |
int Input::KeyDown | ( | ) |
Check if any key is pressed.
void Input::SetEnabled | ( | bool | pause | ) |
Pause or restore the keyboard control.
pause |
|
void Input::SetMousePosition | ( | Point | position | ) |
Set the current mouse cursor position.
position | Point object describing the new location for the mouse. |
Point Input::GetMousePosition | ( | ) |
Return the current mouse cursor position as a pixel offset from the top-left corner of the display.