Search
lxdream.org :: lxdream/src/display.h :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/display.h
changeset 608:4f588e52bce0
prev561:533f6b478071
next614:a2d239d4438a
author nkeynes
date Sat Jan 26 03:44:22 2008 +0000 (16 years ago)
permissions -rw-r--r--
last change Add svn:keywords property
file annotate diff log raw
1.1 --- a/src/display.h Tue Jan 01 05:08:38 2008 +0000
1.2 +++ b/src/display.h Sat Jan 26 03:44:22 2008 +0000
1.3 @@ -118,6 +118,11 @@
1.4 uint16_t (*resolve_keysym)( const gchar *keysym );
1.5
1.6 /**
1.7 + * Given a native system keycode, convert it to a dreamcast keyboard code.
1.8 + */
1.9 + uint16_t (*convert_to_dckeysym)( uint16_t keycode );
1.10 +
1.11 + /**
1.12 * Create a render target with the given width and height.
1.13 */
1.14 render_buffer_t (*create_render_buffer)( uint32_t width, uint32_t height );
1.15 @@ -180,12 +185,38 @@
1.16
1.17 typedef void (*input_key_callback_t)( void *data, uint32_t value, gboolean isKeyDown );
1.18
1.19 +/**
1.20 + * Callback to receive mouse input events
1.21 + * @param data pointer passed in at the time the hook was registered
1.22 + * @param buttons bitmask of button states, where bit 0 is button 0 (left), bit 1 is button
1.23 + * 1 (middle), bit 2 is button 2 (right) and so forth.
1.24 + * @param x Horizontal movement since the last invocation (in relative mode) or window position
1.25 + * (in absolute mode).
1.26 + * @param y Vertical movement since the last invocation (in relative mode) or window position
1.27 + * (in absolute mode).
1.28 + */
1.29 +typedef void (*input_mouse_callback_t)( void *data, uint32_t buttons, int32_t x, int32_t y );
1.30 +
1.31 gboolean input_register_key( const gchar *keysym, input_key_callback_t callback,
1.32 void *data, uint32_t value );
1.33
1.34 void input_unregister_key( const gchar *keysym, input_key_callback_t callback,
1.35 void *data, uint32_t value );
1.36
1.37 +/**
1.38 + * Register a hook to receive all input events
1.39 + */
1.40 +gboolean input_register_hook( input_key_callback_t callback, void *data );
1.41 +void input_unregister_hook( input_key_callback_t callback, void *data );
1.42 +
1.43 +/**
1.44 + * Register a mouse event hook.
1.45 + * @param relative TRUE if the caller wants relative mouse movement, FALSE for
1.46 + * absolute mouse positioning. It's not generally possible to receive both at the same time.
1.47 + */
1.48 +gboolean input_register_mouse_hook( gboolean relative, input_mouse_callback_t callback, void *data );
1.49 +void input_unregister_mouse_hook( input_mouse_callback_t callback, void *data );
1.50 +
1.51 gboolean input_is_key_valid( const gchar *keysym );
1.52
1.53 gboolean input_is_key_registered( const gchar *keysym );
1.54 @@ -194,7 +225,9 @@
1.55
1.56 void input_event_keyup( uint16_t keycode );
1.57
1.58 +void input_event_mouse( uint32_t buttons, int32_t x_axis, int32_t y_axis );
1.59
1.60 +uint16_t input_keycode_to_dckeysym( uint16_t keycode );
1.61
1.62 #ifdef __cplusplus
1.63 }
.