| 395 | } |
| 396 | |
| 397 | KeyModifierMask 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 | |
| 428 | int32_t OSXKeyState::pollActiveGroup() const |
| 429 | { |
nothing calls this directly
no outgoing calls
no test coverage detected