Input Functions
This article is an overview of input related functions.
These functions exist for checking the state of input on desktop computers with a mouse or keyboard.
- keyboard_check_direct
- keyboard_key_press
- keyboard_key_release
- keyboard_get_numlock
- keyboard_get_capital
- keyboard_get_scroll
- keyboard_set_numlock
- keyboard_set_capital
- keyboard_set_scroll
- keyboard_set_map
- keyboard_get_map
- keyboard_unset_map
These functions are for controlling game pad devices such as Xbox 360 and PlayStation 3 controllers, currently only Xbox 360 controllers work on Windows and you must enable the XInput extension. Windows supports up to 4 gamepads connected simultaneously. Gamepad related constants are available here.
- gamepad_is_supported
- gamepad_is_connected
- gamepad_get_device_count
- gamepad_get_description
- gamepad_get_battery_type
- gamepad_get_battery_charge
- gamepad_get_button_threshold
- gamepad_set_button_threshold
- gamepad_set_axis_deadzone
- gamepad_set_vibration
- gamepad_set_color
- gamepad_axis_count
- gamepad_axis_value
- gamepad_button_check
- gamepad_button_check_pressed
- gamepad_button_check_released
- gamepad_button_count
- gamepad_button_value
These functions are for use with joysticks, like those that are often used to play flight simulator games. In the diagram mapping the axis of a joystick below, Roll corresponds to the R joystick axis, Pitch corresponds to the U axis, and Yaw corresponds to the V axis. No more than 16 joysticks at a given time can be handled.
- joystick_load
- joystick_axes
- joystick_buttons
- joystick_check_button
- joystick_direction
- joystick_exists
- joystick_has_pov
- joystick_name
- joystick_pov
- joystick_axis
- joystick_xpos
- joystick_ypos
- joystick_zpos
- joystick_rpos
- joystick_upos
- joystick_vpos