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);
|
const KeyID key = mapKey(&xevent.xkey);
|
||||||
if (key != kKeyNone) {
|
if (key != kKeyNone) {
|
||||||
m_server->onKeyDown(key, mask);
|
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);
|
m_server->onKeyUp(key, mask | KeyModifierCapsLock);
|
||||||
|
}
|
||||||
|
else if (key == XK_Num_Lock && m_numLockHalfDuplex) {
|
||||||
|
m_server->onKeyUp(key, mask | KeyModifierNumLock);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -85,8 +89,12 @@ void CXWindowsPrimaryScreen::run()
|
||||||
(XPointer)&filter) != True) {
|
(XPointer)&filter) != True) {
|
||||||
// no press event follows so it's a plain release
|
// 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));
|
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);
|
m_server->onKeyDown(key, mask);
|
||||||
|
}
|
||||||
|
else if (key == XK_Num_Lock && m_numLockHalfDuplex) {
|
||||||
|
m_server->onKeyDown(key, mask);
|
||||||
|
}
|
||||||
m_server->onKeyUp(key, mask);
|
m_server->onKeyUp(key, mask);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -242,7 +250,9 @@ void CXWindowsPrimaryScreen::open(CServer* server)
|
||||||
|
|
||||||
// check for peculiarities
|
// check for peculiarities
|
||||||
// FIXME -- may have to get these from some database
|
// FIXME -- may have to get these from some database
|
||||||
|
m_numLockHalfDuplex = false;
|
||||||
m_capsLockHalfDuplex = false;
|
m_capsLockHalfDuplex = false;
|
||||||
|
// m_numLockHalfDuplex = true;
|
||||||
// m_capsLockHalfDuplex = true;
|
// m_capsLockHalfDuplex = true;
|
||||||
|
|
||||||
// update key state
|
// update key state
|
||||||
|
|
|
@ -57,8 +57,9 @@ private:
|
||||||
bool m_active;
|
bool m_active;
|
||||||
Window m_window;
|
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)
|
// transition (true)
|
||||||
|
bool m_numLockHalfDuplex;
|
||||||
bool m_capsLockHalfDuplex;
|
bool m_capsLockHalfDuplex;
|
||||||
|
|
||||||
// masks that indicate which modifier bits are for toggle keys
|
// masks that indicate which modifier bits are for toggle keys
|
||||||
|
|
Loading…
Reference in New Issue