Fix #232 MACOS serious config file errors - hotkeys totally broken

This commit is contained in:
Chun Wang 2019-06-15 01:52:08 +09:00 committed by Adrian Lucrèce Céleste
parent 6c19a87f63
commit 0f5cdecf51
1 changed files with 16 additions and 29 deletions

View File

@ -1263,18 +1263,9 @@ OSXScreen::onKey(CGEventRef event)
return true;
}
// check for hot key. when we're on a secondary screen we disable
// all hotkeys so we can capture the OS defined hot keys as regular
// keystrokes but that means we don't get our own hot keys either.
// so we check for a key/modifier match in our hot key map.
if (!m_isOnScreen) {
HotKeyToIDMap::const_iterator i =
m_hotKeyToIDMap.find(HotKeyItem(virtualKey,
m_keyState->mapModifiersToCarbon(macMask)
& 0xff00u));
HotKeyToIDMap::const_iterator i = m_hotKeyToIDMap.find(HotKeyItem(virtualKey, m_keyState->mapModifiersToCarbon(macMask) & 0xff00u));
if (i != m_hotKeyToIDMap.end()) {
UInt32 id = i->second;
// determine event type
Event::Type type;
//UInt32 eventKind = GetEventKind(event);
@ -1287,13 +1278,9 @@ OSXScreen::onKey(CGEventRef event)
else {
return false;
}
m_events->addEvent(Event(type, getEventTarget(),
HotKeyInfo::alloc(id)));
m_events->addEvent(Event(type, getEventTarget(), HotKeyInfo::alloc(id)));
return true;
}
}
// decode event type
bool down = (eventKind == kCGEventKeyDown);