diff --git a/server/CXWindowsPrimaryScreen.cpp b/server/CXWindowsPrimaryScreen.cpp index aacb32b6..bae8ca5c 100644 --- a/server/CXWindowsPrimaryScreen.cpp +++ b/server/CXWindowsPrimaryScreen.cpp @@ -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 diff --git a/server/CXWindowsPrimaryScreen.h b/server/CXWindowsPrimaryScreen.h index 8c521bed..381b013a 100644 --- a/server/CXWindowsPrimaryScreen.h +++ b/server/CXWindowsPrimaryScreen.h @@ -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