Events: Fix ISKEYBOARD macro seeing INPUTCHANGE, WINDEACTIVATE and TIMER events

as keyboard ones!!!

Note: better solution would be to move those 'internal' events to the 0x5xxx area,
but need to talk with the team to be sure this won't break something first.
This commit is contained in:
Bastien Montagne 2014-09-01 17:18:30 +02:00
parent c23733d290
commit 1979ae3a42
1 changed files with 4 additions and 2 deletions

View File

@ -89,7 +89,7 @@ enum {
/* *** Start of keyboard codes. *** */
/* standard keyboard.
* XXX from 0x0020 to 0x00ff, and 0x012c to 0x0140 for function keys! */
* XXX from 0x0020 to 0x00ff, and 0x012c to 0x013f for function keys! */
AKEY = 0x0061, /* 'a' */
BKEY = 0x0062, /* 'b' */
CKEY = 0x0063, /* 'c' */
@ -327,7 +327,9 @@ enum {
/* note, an alternative could be to check 'event->utf8_buf' */
/* test whether the event is a key on the keyboard */
#define ISKEYBOARD(event_type) (event_type >= ' ' && event_type <= 320)
#define ISKEYBOARD(event_type) \
((event_type >= 0x0020 && event_type <= 0x00ff) || \
(event_type >= 0x012c && event_type <= 0x013f))
/* test whether the event is a modifier key */
#define ISKEYMODIFIER(event_type) ((event_type >= LEFTCTRLKEY && event_type <= LEFTSHIFTKEY) || event_type == OSKEY)