diff options
Diffstat (limited to 'src/engine/e_if_inp.h')
| -rw-r--r-- | src/engine/e_if_inp.h | 236 |
1 files changed, 236 insertions, 0 deletions
diff --git a/src/engine/e_if_inp.h b/src/engine/e_if_inp.h new file mode 100644 index 00000000..b95f1177 --- /dev/null +++ b/src/engine/e_if_inp.h @@ -0,0 +1,236 @@ +/* copyright (c) 2007 magnus auvinen, see licence.txt for more info */ +#ifndef ENGINE_IF_INP_H +#define ENGINE_IF_INP_H + +/* + Section: Input +*/ + + +/* + Structure: INPUT_EVENT +*/ +typedef struct +{ + char ch; + int key; +} INPUT_EVENT; + +/* + Function: inp_mouse_relative + Fetches the mouse movements. + + Arguments: + x - Pointer to the variable that should get the X movement. + y - Pointer to the variable that should get the Y movement. +*/ +void inp_mouse_relative(int *x, int *y); + +/* + Function: inp_mouse_scroll + TODO + + Arguments: + arg1 - desc + + Returns: + + See Also: + <other_func> +*/ +int inp_mouse_scroll(); + +/* + Function: inp_key_pressed + Checks if a key is pressed. + + Arguments: + key - Index to the key to check + + Returns: + Returns 1 if the button is pressed, otherwise 0. + + Remarks: + Check keys.h for the keys. +*/ +int inp_key_pressed(int key); + + +/* input */ +/* + Function: inp_key_was_pressed + TODO + + Arguments: + arg1 - desc + + Returns: + + See Also: + <other_func> +*/ +int inp_key_was_pressed(int key); + +/* + Function: inp_key_down + TODO + + Arguments: + arg1 - desc + + Returns: + + See Also: + <other_func> +*/ +int inp_key_down(int key); + + +/* + Function: inp_num_events + TODO + + Arguments: + arg1 - desc + + Returns: + + See Also: + <other_func> +*/ +int inp_num_events(); + +/* + Function: inp_get_event + TODO + + Arguments: + arg1 - desc + + Returns: + + See Also: + <other_func> +*/ +INPUT_EVENT inp_get_event(int index); + +/* + Function: inp_clear_events + TODO + + Arguments: + arg1 - desc + + Returns: + + See Also: + <other_func> +*/ +void inp_clear_events(); + +/* + Function: inp_mouse_doubleclick + TODO + + Arguments: + arg1 - desc + + Returns: + + See Also: + <other_func> +*/ +int inp_mouse_doubleclick(); + +/* + Function: inp_key_presses + TODO + + Arguments: + arg1 - desc + + Returns: + + See Also: + <other_func> +*/ +int inp_key_presses(int key); + +/* + Function: inp_key_releases + TODO + + Arguments: + arg1 - desc + + Returns: + + See Also: + <other_func> +*/ +int inp_key_releases(int key); + +/* + Function: inp_key_state + TODO + + Arguments: + arg1 - desc + + Returns: + + See Also: + <other_func> +*/ +int inp_key_state(int key); + +/* + Function: inp_key_name + TODO + + Arguments: + arg1 - desc + + Returns: + + See Also: + <other_func> +*/ +const char *inp_key_name(int k); + +/* + Function: inp_key_code + TODO + + Arguments: + arg1 - desc + + Returns: + + See Also: + <other_func> +*/ +int inp_key_code(const char *key_name); + + + +/* + Function: inp_clear_key_states + TODO + + Arguments: + arg1 - desc + + Returns: + + See Also: + <other_func> +*/ +void inp_clear_key_states(); + +void inp_update(); +void inp_init(); +void inp_mouse_mode_absolute(); +void inp_mouse_mode_relative(); + +#endif |