@@ -1001,28 +1001,32 @@ GHOST_TSuccess GHOST_SystemCocoa::handleApplicationBecomeActiveEvent()
|
||||
(modifiers & NSEventModifierFlagShift) ? GHOST_kEventKeyDown :
|
||||
GHOST_kEventKeyUp,
|
||||
window,
|
||||
GHOST_kKeyLeftShift));
|
||||
GHOST_kKeyLeftShift,
|
||||
false));
|
||||
}
|
||||
if ((modifiers & NSEventModifierFlagControl) != (m_modifierMask & NSEventModifierFlagControl)) {
|
||||
pushEvent(new GHOST_EventKey(getMilliSeconds(),
|
||||
(modifiers & NSEventModifierFlagControl) ? GHOST_kEventKeyDown :
|
||||
GHOST_kEventKeyUp,
|
||||
window,
|
||||
GHOST_kKeyLeftControl));
|
||||
GHOST_kKeyLeftControl,
|
||||
false));
|
||||
}
|
||||
if ((modifiers & NSEventModifierFlagOption) != (m_modifierMask & NSEventModifierFlagOption)) {
|
||||
pushEvent(new GHOST_EventKey(getMilliSeconds(),
|
||||
(modifiers & NSEventModifierFlagOption) ? GHOST_kEventKeyDown :
|
||||
GHOST_kEventKeyUp,
|
||||
window,
|
||||
GHOST_kKeyLeftAlt));
|
||||
GHOST_kKeyLeftAlt,
|
||||
false));
|
||||
}
|
||||
if ((modifiers & NSEventModifierFlagCommand) != (m_modifierMask & NSEventModifierFlagCommand)) {
|
||||
pushEvent(new GHOST_EventKey(getMilliSeconds(),
|
||||
(modifiers & NSEventModifierFlagCommand) ? GHOST_kEventKeyDown :
|
||||
GHOST_kEventKeyUp,
|
||||
window,
|
||||
GHOST_kKeyOS));
|
||||
GHOST_kKeyOS,
|
||||
false));
|
||||
}
|
||||
|
||||
m_modifierMask = modifiers;
|
||||
@@ -1805,8 +1809,13 @@ GHOST_TSuccess GHOST_SystemCocoa::handleKeyEvent(void *eventPtr)
|
||||
}
|
||||
|
||||
if ([event type] == NSEventTypeKeyDown) {
|
||||
pushEvent(new GHOST_EventKey(
|
||||
[event timestamp] * 1000, GHOST_kEventKeyDown, window, keyCode, ascii, utf8_buf, false));
|
||||
pushEvent(new GHOST_EventKey([event timestamp] * 1000,
|
||||
GHOST_kEventKeyDown,
|
||||
window,
|
||||
keyCode,
|
||||
ascii,
|
||||
utf8_buf,
|
||||
false));
|
||||
#if 0
|
||||
printf("Key down rawCode=0x%x charsIgnoringModifiers=%c keyCode=%u ascii=%i %c utf8=%s\n",
|
||||
[event keyCode],
|
||||
@@ -1843,7 +1852,8 @@ GHOST_TSuccess GHOST_SystemCocoa::handleKeyEvent(void *eventPtr)
|
||||
(modifiers & NSEventModifierFlagShift) ? GHOST_kEventKeyDown :
|
||||
GHOST_kEventKeyUp,
|
||||
window,
|
||||
GHOST_kKeyLeftShift));
|
||||
GHOST_kKeyLeftShift,
|
||||
false));
|
||||
}
|
||||
if ((modifiers & NSEventModifierFlagControl) !=
|
||||
(m_modifierMask & NSEventModifierFlagControl)) {
|
||||
@@ -1851,7 +1861,8 @@ GHOST_TSuccess GHOST_SystemCocoa::handleKeyEvent(void *eventPtr)
|
||||
[event timestamp] * 1000,
|
||||
(modifiers & NSEventModifierFlagControl) ? GHOST_kEventKeyDown : GHOST_kEventKeyUp,
|
||||
window,
|
||||
GHOST_kKeyLeftControl));
|
||||
GHOST_kKeyLeftControl,
|
||||
false));
|
||||
}
|
||||
if ((modifiers & NSEventModifierFlagOption) !=
|
||||
(m_modifierMask & NSEventModifierFlagOption)) {
|
||||
@@ -1859,7 +1870,8 @@ GHOST_TSuccess GHOST_SystemCocoa::handleKeyEvent(void *eventPtr)
|
||||
[event timestamp] * 1000,
|
||||
(modifiers & NSEventModifierFlagOption) ? GHOST_kEventKeyDown : GHOST_kEventKeyUp,
|
||||
window,
|
||||
GHOST_kKeyLeftAlt));
|
||||
GHOST_kKeyLeftAlt,
|
||||
false));
|
||||
}
|
||||
if ((modifiers & NSEventModifierFlagCommand) !=
|
||||
(m_modifierMask & NSEventModifierFlagCommand)) {
|
||||
@@ -1867,7 +1879,8 @@ GHOST_TSuccess GHOST_SystemCocoa::handleKeyEvent(void *eventPtr)
|
||||
[event timestamp] * 1000,
|
||||
(modifiers & NSEventModifierFlagCommand) ? GHOST_kEventKeyDown : GHOST_kEventKeyUp,
|
||||
window,
|
||||
GHOST_kKeyOS));
|
||||
GHOST_kKeyOS,
|
||||
false));
|
||||
}
|
||||
|
||||
m_modifierMask = modifiers;
|
||||
|
||||
Reference in New Issue
Block a user