- int key_status = (event->type == KeyPress ? KEY_PRESSED : KEY_RELEASED);
- KeySym key;
-
- if (game_status == PLAYING)
- {
- /* use '0' instead of 'event->state' to get the key without modifiers */
- key = XLookupKeysym(event, 0);
- }
- else
- {
- /* get the key with all modifiers */
- char buffer[10];
- int buffer_size = 10;
- XComposeStatus compose;
- int char_count;
-
- char_count = XLookupString(event, buffer, buffer_size, &key, &compose);
- buffer[char_count] = '\0';
- }
+ int key_status = (event->type==EVENT_KEYPRESS ? KEY_PRESSED : KEY_RELEASED);
+ boolean with_modifiers = (game_status == PLAYING ? FALSE : TRUE);
+ Key key = GetEventKey(event, with_modifiers);