mirror of
https://github.com/debauchee/barrier.git
synced 2024-11-23 00:56:21 +03:00
checkpoint. added half duplex for num lock.
This commit is contained in:
parent
cd3e49a9a9
commit
2dad59a027
@ -57,8 +57,12 @@ void CXWindowsPrimaryScreen::run()
|
||||
const KeyID key = mapKey(&xevent.xkey);
|
||||
if (key != kKeyNone) {
|
||||
m_server->onKeyDown(key, mask);
|
||||
if (key == XK_Caps_Lock && m_capsLockHalfDuplex)
|
||||
if (key == XK_Caps_Lock && m_capsLockHalfDuplex) {
|
||||
m_server->onKeyUp(key, mask | KeyModifierCapsLock);
|
||||
}
|
||||
else if (key == XK_Num_Lock && m_numLockHalfDuplex) {
|
||||
m_server->onKeyUp(key, mask | KeyModifierNumLock);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -85,8 +89,12 @@ void CXWindowsPrimaryScreen::run()
|
||||
(XPointer)&filter) != True) {
|
||||
// no press event follows so it's a plain release
|
||||
log((CLOG_DEBUG1 "event: KeyRelease code=%d, state=0x%04x", xevent.xkey.keycode, xevent.xkey.state));
|
||||
if (key == XK_Caps_Lock && m_capsLockHalfDuplex)
|
||||
if (key == XK_Caps_Lock && m_capsLockHalfDuplex) {
|
||||
m_server->onKeyDown(key, mask);
|
||||
}
|
||||
else if (key == XK_Num_Lock && m_numLockHalfDuplex) {
|
||||
m_server->onKeyDown(key, mask);
|
||||
}
|
||||
m_server->onKeyUp(key, mask);
|
||||
}
|
||||
else {
|
||||
@ -242,7 +250,9 @@ void CXWindowsPrimaryScreen::open(CServer* server)
|
||||
|
||||
// check for peculiarities
|
||||
// FIXME -- may have to get these from some database
|
||||
m_numLockHalfDuplex = false;
|
||||
m_capsLockHalfDuplex = false;
|
||||
// m_numLockHalfDuplex = true;
|
||||
// m_capsLockHalfDuplex = true;
|
||||
|
||||
// update key state
|
||||
|
@ -57,8 +57,9 @@ private:
|
||||
bool m_active;
|
||||
Window m_window;
|
||||
|
||||
// note if caps lock key toggles on up/down (false) or on
|
||||
// note toggle keys that toggle on up/down (false) or on
|
||||
// transition (true)
|
||||
bool m_numLockHalfDuplex;
|
||||
bool m_capsLockHalfDuplex;
|
||||
|
||||
// masks that indicate which modifier bits are for toggle keys
|
||||
|
Loading…
Reference in New Issue
Block a user