[ Back to Geeks3D.com ]
 GeeXLab
Laboratory for Real Time 3D Programming (prototyping and demos) OpenGL, Lua, Python, GLSL, PhysX and more...Reference Guide Host-API Lua / Python
» Back to Homepage
» Back to Developer's Guide Index
HYP_Input Library
User input library
Number of functions: 14
HYP_Input.SetDefaultInputManagementState
SetDefaultInputManagementState enables or disables the user input default management (keyboard, mouse).
It is recommended to totally disable the default management in case the user wants to use its own camera routines.
: Lua - Python
state [INTEGER]: enables (1) or disables (0) user input default management - Values = 0|1
:
HYP_Input.SetDefaultInputManagementState(0)
HYP_Input.IsKeyboardKeyPressed
Returns the state of a specific key.
: Lua - Python
key [INTEGER]: key code
isPressed [INTEGER]: state of the key: 1 if down or 0 if up.
:
HYP_KEY_A = 65
state = HYP_Input.IsKeyboardKeyPressed(HYP_KEY_A)
HYP_Input.GetKeyState
Returns the state of a key.
: Lua - Python
key [INTEGER]: key code
state [INTEGER]: state of the key: 1 if down or 0 if up.
:
HYP_KEY_A = 65
state = HYP_Input.GetKeyState(HYP_KEY_A)
HYP_Input.GetMousePos
Returns mouse's position in screen space: position (0;0) is the top-left corner.
: Lua - Python
x, y [INTEGER]: mouse's position.
:
x, y = HYP_Input.GetMousePos()
HYP_Input.GetMousePositionInWorldSpace
converts mouse position in screen space to 2D space. In 2D space, the position (0;0) is on the center of the screen.
: Lua - Python
x, y [INTEGER]: mouse'position in world 2D space: the position (0;0) is in window's center.
:
x, y = HYP_Input.GetMousePositionInWorldSpace()
HYP_Input.SetMousePos
Sets mouse's position in screen space: position (0;0) is the top-left corner.
: Lua - Python
x, y [INTEGER]: mouse's position.
:
HYP_Input.SetMousePos(x, y)
HYP_Input.SetMouseWheelDefaultManagementState
Allows to enable or disable the default management of mouse's wheel.
: Lua - Python
state [INTEGER]: 1 (enabled) or 0 (disabled)
:
HYP_Input.SetMouseWheelDefaultManagementState(0)
HYP_Input.GetMouseWheelDelta
Returns mouse's wheel delta value.
: Lua - Python
delta [INTEGER]: mouse's wheel delta.
:
delta = HYP_Input.GetMouseWheelDelta()
HYP_Input.ShowMouseCursor
Shows mouse's cursor.
: Lua - Python
:
HYP_Input.ShowMouseCursor()
HYP_Input.HideMouseCursor
Hides mouse's cursor.
: Lua - Python
:
HYP_Input.HideMouseCursor()
HYP_Input.GetMouseButtonState
Returns the state of mouse's buttons.
: Lua - Python
button [INTEGER]: specifies the button of the mouse to be tested: 1 (left) or 2 (right).
state [INTEGER]: state of button: 1 for bufton down or 0 for button up
:
state = HYP_Input.GetMouseButtonState(1)
HYP_Input.IsJoystickEnabled
Checks that a particular joystick has been correctly initialized. Currently, only 2 joysticks are supported.
: Lua - Python
joyId [INTEGER]: Specifies the joystick to be tested: 1 or 2.
state [INTEGER]: 1 if the joystick is correctly initialized and 0 if not
:
state = HYP_Input.IsJoystickEnabled(1)
HYP_Input.GetJoystickButtonState
Allows to know if a joystick button has been pressed. Currently only the first 4 buttons are supported.
: Lua - Python
joyId [INTEGER]: Specifies the joystick to be tested: 1 or 2.
button [INTEGER]: Specifies the button to be tested: 0, 1, 2 or 3.
state [INTEGER]: 1 if the button has been pressed and 0 if not.
:
state = HYP_Input.GetJoystickButtonState(1, 3)
HYP_Input.GetJoystickPosition
Returns get the joystick's position on X and Y axis.
: Lua - Python
joyId [INTEGER]: Specifies the joystick to be tested: 1 or 2.
x, y [INTEGER]: joystick's position.
:
x, y = HYP_Input.GetJoystickPosition(1)
|