From 2beb36c2a53b49170be7a3001bc4744c7deaf83d Mon Sep 17 00:00:00 2001 From: William Breathitt Gray Date: Sun, 22 Jun 2014 19:28:00 -0400 Subject: [PATCH] The xcb_key_symbols_get_keycode function returns a pointer which must be dereferenced in order to get the respective keycode. --- app/xte/xte.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/xte/xte.c b/app/xte/xte.c index b400879..4b7d04f 100644 --- a/app/xte/xte.c +++ b/app/xte/xte.c @@ -62,7 +62,7 @@ uint8_t thing_to_keycode( xcb_connection_t *c, char *thing ) { ks = (uint8_t)thing[0]; #endif - kc = xcb_key_symbols_get_keycode( syms, ks ); + kc = *(xcb_key_symbols_get_keycode( syms, ks )); dmsg( 1, "String '%s' maps to keysym '%d'\n", thing, ks ); dmsg( 1, "String '%s' maps to keycode '%d'\n", thing, kc ); @@ -116,9 +116,9 @@ void send_key( xcb_connection_t *c, char *thing ) { const char *cap = "~!@#$%^&*()_+{}|:\"<>?"; if (thing[0] >= 'A' && thing[0] <= 'Z') - wrap_code = xcb_key_symbols_get_keycode( syms, shift ); + wrap_code = *(xcb_key_symbols_get_keycode( syms, shift )); else if (strchr(cap, thing[0]) != NULL) - wrap_code = xcb_key_symbols_get_keycode( syms, shift ); + wrap_code = *(xcb_key_symbols_get_keycode( syms, shift )); #endif code = thing_to_keycode( c, thing ); @@ -201,17 +201,17 @@ void process_command( xcb_connection_t *c, const char *cmd ) { xcb_keysym_t sym; xcb_keycode_t code; sscanf( str, "sym %x", &sym ); - code = xcb_key_symbols_get_keycode( syms, sym ); + code = *(xcb_key_symbols_get_keycode( syms, sym )); fake_input( c, XCB_KEY_PRESS, code ); fake_input( c, XCB_KEY_RELEASE, code ); }else if( IS_CMD( cmd, "symdown " ) ) { xcb_keysym_t sym; sscanf( str, "symdown %x", &sym ); - fake_input( c, XCB_KEY_PRESS, xcb_key_symbols_get_keycode( syms, sym ) ); + fake_input( c, XCB_KEY_PRESS, *(xcb_key_symbols_get_keycode( syms, sym ) )); }else if( IS_CMD( cmd, "symup " ) ) { xcb_keysym_t sym; sscanf( str, "symup %x", &sym ); - fake_input( c, XCB_KEY_RELEASE, xcb_key_symbols_get_keycode( syms, sym ) ); + fake_input( c, XCB_KEY_RELEASE, *(xcb_key_symbols_get_keycode( syms, sym ) )); }else{ fprintf( stderr, "Unknown command '%s'\n", cmd ); } -- 1.8.5.5