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

Method getEffectiveGroup

src/lib/platform/XWindowsKeyState.cpp:821–848  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

819}
820
821int XWindowsKeyState::getEffectiveGroup(KeyCode keycode, int group) const
822{
823 (void)keycode;
824#if HAVE_XKB_EXTENSION
825 // get effective group for key
826 if (int numGroups = XkbKeyNumGroups(m_xkb, keycode); group >= numGroups) {
827 unsigned char groupInfo = XkbKeyGroupInfo(m_xkb, keycode);
828 switch (XkbOutOfRangeGroupAction(groupInfo)) {
829 case XkbClampIntoRange:
830 group = numGroups - 1;
831 break;
832
833 case XkbRedirectIntoRange:
834 group = XkbOutOfRangeGroupNumber(groupInfo);
835 if (group >= numGroups) {
836 group = 0;
837 }
838 break;
839
840 default:
841 // wrap
842 group %= numGroups;
843 break;
844 }
845 }
846#endif
847 return group;
848}
849
850uint32_t XWindowsKeyState::getGroupFromState(unsigned int state) const
851{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected