Search
lxdream.org :: lxdream/src/display.h :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/display.h
changeset 849:bbe26d798fc2
prev839:51f1c4195790
next850:28782ebbd01d
author nkeynes
date Mon Sep 08 05:13:51 2008 +0000 (12 years ago)
permissions -rw-r--r--
last change Refactor mouse event management - button events are now usable for controllers
file annotate diff log raw
1.1 --- a/src/display.h Tue Sep 02 03:34:00 2008 +0000
1.2 +++ b/src/display.h Mon Sep 08 05:13:51 2008 +0000
1.3 @@ -213,6 +213,8 @@
1.4
1.5 /****************** Input methods **********************/
1.6
1.7 +#define MAX_MOUSE_BUTTONS 32
1.8 +
1.9 typedef void (*input_key_callback_t)( void *data, uint32_t value, uint32_t pressure, gboolean isKeyDown );
1.10
1.11 /**
1.12 @@ -236,10 +238,10 @@
1.13 void *data, uint32_t value );
1.14
1.15 /**
1.16 - * Register a hook to receive all input events
1.17 + * Register a hook to receive all keyboard input events
1.18 */
1.19 -gboolean input_register_hook( input_key_callback_t callback, void *data );
1.20 -void input_unregister_hook( input_key_callback_t callback, void *data );
1.21 +gboolean input_register_keyboard_hook( input_key_callback_t callback, void *data );
1.22 +void input_unregister_keyboard_hook( input_key_callback_t callback, void *data );
1.23
1.24 /**
1.25 * Register a mouse event hook.
1.26 @@ -292,6 +294,8 @@
1.27
1.28 } *input_driver_t;
1.29
1.30 +extern struct input_driver system_mouse_driver;
1.31 +
1.32 /**
1.33 * Register a new input driver (which must have a unique name)
1.34 * @param driver the driver to register
1.35 @@ -326,15 +330,36 @@
1.36 void input_event_keyup( input_driver_t input, uint16_t keycode, uint32_t pressure );
1.37
1.38 /**
1.39 - * Receive an input mouse event. Normally these should be absolute events when
1.40 + * Receive an input mouse down event. Normally these should be absolute events when
1.41 * the mouse is not grabbed, and relative when it is.
1.42 - * @param buttons a bitmask of buttons currently held now (bit 0 = button 1, bit 1 = button 2, etc)
1.43 + * @param button the button pressed, where 0 == first button
1.44 * @param x_axis The relative or absolute position of the mouse cursor on the X axis
1.45 * @param y_axis The relative or absolute position of the mouse cursor on the Y axis
1.46 * @param absolute If TRUE, x_axis and y_axis are the current window coordinates
1.47 * of the mouse cursor. Otherwise, x_axis and y_axis are deltas from the previous mouse position.
1.48 */
1.49 -void input_event_mouse( uint32_t buttons, int32_t x_axis, int32_t y_axis, gboolean absolute );
1.50 +void input_event_mousedown( uint16_t button, int32_t x_axis, int32_t y_axis, gboolean absolute );
1.51 +
1.52 +/**
1.53 + * Receive an input mouse up event. Normally these should be absolute events when
1.54 + * the mouse is not grabbed, and relative when it is.
1.55 + * @param button the button released, where 0 == first button
1.56 + * @param x_axis The relative or absolute position of the mouse cursor on the X axis
1.57 + * @param y_axis The relative or absolute position of the mouse cursor on the Y axis
1.58 + * @param absolute If TRUE, x_axis and y_axis are the current window coordinates
1.59 + * of the mouse cursor. Otherwise, x_axis and y_axis are deltas from the previous mouse position.
1.60 + */
1.61 +void input_event_mouseup( uint16_t button, int32_t x_axis, int32_t y_axis, gboolean absolute );
1.62 +
1.63 +/**
1.64 + * Receive an input mouse motion event. Normally these should be absolute events when
1.65 + * the mouse is not grabbed, and relative when it is.
1.66 + * @param x_axis The relative or absolute position of the mouse cursor on the X axis
1.67 + * @param y_axis The relative or absolute position of the mouse cursor on the Y axis
1.68 + * @param absolute If TRUE, x_axis and y_axis are the current window coordinates
1.69 + * of the mouse cursor. Otherwise, x_axis and y_axis are deltas from the previous mouse position.
1.70 + */
1.71 +void input_event_mousemove( int32_t x_axis, int32_t y_axis, gboolean absolute );
1.72
1.73 /**
1.74 * Given a keycode and the originating input driver, return the corresponding
.