MCPcopy Create free account
hub / github.com/deskflow/deskflow / pollActiveModifiers

Method pollActiveModifiers

src/lib/platform/OSXKeyState.cpp:397–426  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

395}
396
397KeyModifierMask OSXKeyState::pollActiveModifiers() const
398{
399 // falsely assumed that the mask returned by GetCurrentKeyModifiers()
400 // was the same as a CGEventFlags (which is what mapModifiersFromOSX
401 // expects). patch by Marc
402 uint32_t mask = GetCurrentKeyModifiers();
403 KeyModifierMask outMask = 0;
404
405 if ((mask & shiftKey) != 0) {
406 outMask |= KeyModifierShift;
407 }
408 if ((mask & controlKey) != 0) {
409 outMask |= KeyModifierControl;
410 }
411 if ((mask & optionKey) != 0) {
412 outMask |= KeyModifierAlt;
413 }
414 if ((mask & cmdKey) != 0) {
415 outMask |= KeyModifierSuper;
416 }
417 if ((mask & alphaLock) != 0) {
418 outMask |= KeyModifierCapsLock;
419 }
420 if ((mask & s_osxNumLock) != 0) {
421 outMask |= KeyModifierNumLock;
422 }
423
424 LOG_DEBUG1("mask=%04x outMask=%04x", mask, outMask);
425 return outMask;
426}
427
428int32_t OSXKeyState::pollActiveGroup() const
429{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected