Search
lxdream.org :: lxdream/src/display.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/display.c
changeset 451:50622730f226
prev431:248dd77a9e44
next477:9a373f2ff009
author nkeynes
date Sun Oct 21 05:15:56 2007 +0000 (12 years ago)
permissions -rw-r--r--
last change Unregister keys on controller detach
file annotate diff log raw
1.1 --- a/src/display.c Tue Oct 09 08:12:29 2007 +0000
1.2 +++ b/src/display.c Sun Oct 21 05:15:56 2007 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: display.c,v 1.10 2007-10-09 08:12:29 nkeynes Exp $
1.6 + * $Id: display.c,v 1.11 2007-10-21 05:15:56 nkeynes Exp $
1.7 *
1.8 * Generic support for keyboard and other input sources. The active display
1.9 * driver is expected to deliver events here, where they're translated and
1.10 @@ -38,9 +38,9 @@
1.11 { GL_UNSIGNED_SHORT_1_5_5_5_REV, GL_BGRA, GL_RGB5_A1, 2 },
1.12 { GL_UNSIGNED_SHORT_5_6_5, GL_RGB, GL_RGB5, 2 },
1.13 { GL_UNSIGNED_SHORT_4_4_4_4_REV, GL_BGRA, GL_RGBA4, 2 },
1.14 - { GL_UNSIGNED_INT_8_8_8_8_REV, GL_BGRA, GL_RGBA8, 4 }, /* YUV decoded to ARGB8888 */
1.15 + { GL_UNSIGNED_BYTE, GL_BGRA, GL_RGBA8, 4 }, /* YUV decoded to ARGB8888 */
1.16 { GL_UNSIGNED_BYTE, GL_BGR, GL_RGB, 3 },
1.17 - { GL_UNSIGNED_INT_8_8_8_8_REV, GL_BGRA, GL_RGBA8, 4 },
1.18 + { GL_UNSIGNED_BYTE, GL_BGRA, GL_RGBA8, 4 },
1.19
1.20 };
1.21
1.22 @@ -62,10 +62,11 @@
1.23 return key;
1.24 }
1.25
1.26 -static void input_delete_key( uint16_t keycode )
1.27 +static void input_delete_key( uint16_t keycode, input_key_callback_t callback, void *data,
1.28 + uint32_t value )
1.29 {
1.30 struct keymap_entry *key = keymap[keycode];
1.31 - if( key != NULL ) {
1.32 + if( key != NULL && key->callback == callback && key->data == data && key->value == value ) {
1.33 free( key );
1.34 keymap[keycode] = NULL;
1.35 }
1.36 @@ -98,14 +99,15 @@
1.37 return TRUE;
1.38 }
1.39
1.40 -void input_unregister_key( const gchar *keysym )
1.41 +void input_unregister_key( const gchar *keysym, input_key_callback_t callback,
1.42 + void *data, uint32_t value )
1.43 {
1.44 if( display_driver == NULL || keysym == NULL )
1.45 return;
1.46 uint16_t keycode = display_driver->resolve_keysym(keysym);
1.47 if( keycode == 0 )
1.48 return;
1.49 - input_delete_key( keycode );
1.50 + input_delete_key( keycode, callback, data, value );
1.51 }
1.52
1.53
.