386 |
386 |
387 // check scancode for BACKQUOTE key, because we want the key left of "1", not anything else (on non-US keyboards) |
387 // check scancode for BACKQUOTE key, because we want the key left of "1", not anything else (on non-US keyboards) |
388 #if defined(WIN32) |
388 #if defined(WIN32) |
389 if (sym->scancode == 41) key |= WKC_BACKQUOTE; |
389 if (sym->scancode == 41) key |= WKC_BACKQUOTE; |
390 #else |
390 #else |
391 if (sym->scancode == 49) key |= WKC_BACKQUOTE; |
391 #if defined(__APPLE__) |
|
392 if (sym->scancode == 10) key |= WKC_BACKQUOTE; |
|
393 #else |
|
394 if (sym->scancode == 49) key |= WKC_BACKQUOTE; |
|
395 #endif |
392 #endif |
396 #endif |
393 // META are the command keys on mac |
397 // META are the command keys on mac |
394 if (sym->mod & KMOD_META) key |= WKC_META; |
398 if (sym->mod & KMOD_META) key |= WKC_META; |
395 if (sym->mod & KMOD_SHIFT) key |= WKC_SHIFT; |
399 if (sym->mod & KMOD_SHIFT) key |= WKC_SHIFT; |
396 if (sym->mod & KMOD_CTRL) key |= WKC_CTRL; |
400 if (sym->mod & KMOD_CTRL) key |= WKC_CTRL; |
397 if (sym->mod & KMOD_ALT) key |= WKC_ALT; |
401 if (sym->mod & KMOD_ALT) key |= WKC_ALT; |
|
402 // these two lines really helps porting hotkey combos. Uncomment to use -- Bjarni |
|
403 //printf("scancode character pressed %d\n", sym->scancode); |
|
404 //printf("unicode character pressed %d\n", sym->unicode); |
398 return (key << 16) + sym->unicode; |
405 return (key << 16) + sym->unicode; |
399 } |
406 } |
400 |
407 |
401 static int PollEvent() { |
408 static int PollEvent() { |
402 SDL_Event ev; |
409 SDL_Event ev; |