mirror of
https://github.com/debauchee/barrier.git
synced 2026-05-08 23:14:20 +08:00
Rewrote handling of key press on X11 client; it should be much
more robust now. Also added handling of Super modifier key and changed windows keys to map to Super instead of Meta, which is the default on my keyboard.
This commit is contained in:
@@ -625,6 +625,8 @@ CXWindowsPrimaryScreen::mapModifier(unsigned int state) const
|
||||
mask |= KeyModifierAlt;
|
||||
if (state & m_metaMask)
|
||||
mask |= KeyModifierMeta;
|
||||
if (state & m_superMask)
|
||||
mask |= KeyModifierSuper;
|
||||
if (state & m_modeSwitchMask)
|
||||
mask |= KeyModifierModeSwitch;
|
||||
if (state & m_numLockMask)
|
||||
@@ -691,6 +693,7 @@ CXWindowsPrimaryScreen::updateKeys()
|
||||
// initialize
|
||||
m_altMask = 0;
|
||||
m_metaMask = 0;
|
||||
m_superMask = 0;
|
||||
m_modeSwitchMask = 0;
|
||||
m_numLockMask = 0;
|
||||
m_capsLockMask = 0;
|
||||
@@ -721,6 +724,11 @@ CXWindowsPrimaryScreen::updateKeys()
|
||||
m_metaMask |= bit;
|
||||
break;
|
||||
|
||||
case XK_Super_L:
|
||||
case XK_Super_R:
|
||||
m_superMask |= bit;
|
||||
break;
|
||||
|
||||
case XK_Mode_switch:
|
||||
m_modeSwitchMask |= bit;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user