Changeset View
Changeset View
Standalone View
Standalone View
intern/ghost/intern/GHOST_SystemWin32.cpp
| Show First 20 Lines • Show All 1,038 Lines • ▼ Show 20 Lines | |||||
| GHOST_EventKey *GHOST_SystemWin32::processKeyEvent(GHOST_WindowWin32 *window, RAWINPUT const &raw) | GHOST_EventKey *GHOST_SystemWin32::processKeyEvent(GHOST_WindowWin32 *window, RAWINPUT const &raw) | ||||
| { | { | ||||
| int keyDown = 0; | int keyDown = 0; | ||||
| char vk; | char vk; | ||||
| GHOST_SystemWin32 *system = (GHOST_SystemWin32 *)getSystem(); | GHOST_SystemWin32 *system = (GHOST_SystemWin32 *)getSystem(); | ||||
| GHOST_TKey key = system->hardKey(raw, &keyDown, &vk); | GHOST_TKey key = system->hardKey(raw, &keyDown, &vk); | ||||
| GHOST_EventKey *event; | GHOST_EventKey *event; | ||||
| if (key != GHOST_kKeyUnknown) { | { | ||||
| char utf8_char[6] = {0}; | char utf8_char[6] = {0}; | ||||
| char ascii = 0; | char ascii = 0; | ||||
| bool is_repeat = false; | bool is_repeat = false; | ||||
| /* Unlike on Linux, not all keys can send repeat events. E.g. modifier keys don't. */ | /* Unlike on Linux, not all keys can send repeat events. E.g. modifier keys don't. */ | ||||
| if (keyDown) { | if (keyDown) { | ||||
| if (system->m_keycode_last_repeat_key == vk) { | if (system->m_keycode_last_repeat_key == vk) { | ||||
| is_repeat = true; | is_repeat = true; | ||||
| ▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | event = new GHOST_EventKey(system->getMilliSeconds(), | ||||
| window, | window, | ||||
| key, | key, | ||||
| ascii, | ascii, | ||||
| utf8_char, | utf8_char, | ||||
| is_repeat); | is_repeat); | ||||
| // GHOST_PRINTF("%c\n", ascii); // we already get this info via EventPrinter | // GHOST_PRINTF("%c\n", ascii); // we already get this info via EventPrinter | ||||
| } | } | ||||
| else { | |||||
| event = NULL; | |||||
| } | |||||
| return event; | return event; | ||||
| } | } | ||||
| GHOST_Event *GHOST_SystemWin32::processWindowEvent(GHOST_TEventType type, | GHOST_Event *GHOST_SystemWin32::processWindowEvent(GHOST_TEventType type, | ||||
| GHOST_WindowWin32 *window) | GHOST_WindowWin32 *window) | ||||
| { | { | ||||
| GHOST_SystemWin32 *system = (GHOST_SystemWin32 *)getSystem(); | GHOST_SystemWin32 *system = (GHOST_SystemWin32 *)getSystem(); | ||||
| ▲ Show 20 Lines • Show All 879 Lines • Show Last 20 Lines | |||||