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

Method pollActiveModifiers

src/lib/platform/MSWindowsKeyState.cpp:791–815  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

789}
790
791KeyModifierMask MSWindowsKeyState::pollActiveModifiers() const
792{
793 KeyModifierMask state = 0;
794
795 // get non-toggle modifiers from our own shadow key state
796 for (size_t i = 0; i < sizeof(s_modifiers) / sizeof(s_modifiers[0]); ++i) {
797 KeyButton button = virtualKeyToButton(s_modifiers[i].m_vk);
798 if (button != 0 && isKeyDown(button)) {
799 state |= s_modifiers[i].m_mask;
800 }
801 }
802
803 // we can get toggle modifiers from the system
804 if ((GetKeyState(VK_CAPITAL) & 0x01) != 0) {
805 state |= KeyModifierCapsLock;
806 }
807 if ((GetKeyState(VK_NUMLOCK) & 0x01) != 0) {
808 state |= KeyModifierNumLock;
809 }
810 if ((GetKeyState(VK_SCROLL) & 0x01) != 0) {
811 state |= KeyModifierScrollLock;
812 }
813
814 return state;
815}
816
817int32_t MSWindowsKeyState::pollActiveGroup() const
818{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected