Added hack to handle "half-duplex" caps-lock key on powerbook.
That key only reports press when pressed and released when caps-lock is activated and only reports release when pressed and released when caps-lock is deactivated. I don't know of a way to detect this behavior so it may have to be configured by the user. The code assumes normal behavior; will have to add code to set the flag (perhaps from a user configuration).
This commit is contained in:
parent
419eadfaf9
commit
242109d430
|
@ -5,6 +5,8 @@
|
|||
#include <assert.h>
|
||||
#include <X11/X.h>
|
||||
#include <X11/Xutil.h>
|
||||
#define XK_MISCELLANY
|
||||
#include <X11/keysymdef.h>
|
||||
|
||||
//
|
||||
// CXWindowsPrimaryScreen
|
||||
|
@ -54,6 +56,8 @@ void CXWindowsPrimaryScreen::run()
|
|||
const KeyID key = mapKey(&xevent.xkey);
|
||||
if (key != kKeyNone) {
|
||||
m_server->onKeyDown(key, mask);
|
||||
if (key == XK_Caps_Lock && m_capsLockHalfDuplex)
|
||||
m_server->onKeyUp(key, mask | KeyModifierCapsLock);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -65,6 +69,8 @@ void CXWindowsPrimaryScreen::run()
|
|||
const KeyModifierMask mask = mapModifier(xevent.xkey.state);
|
||||
const KeyID key = mapKey(&xevent.xkey);
|
||||
if (key != kKeyNone) {
|
||||
if (key == XK_Caps_Lock && m_capsLockHalfDuplex)
|
||||
m_server->onKeyDown(key, mask);
|
||||
m_server->onKeyUp(key, mask);
|
||||
}
|
||||
break;
|
||||
|
@ -193,6 +199,11 @@ void CXWindowsPrimaryScreen::open(CServer* server)
|
|||
|
||||
// open the display
|
||||
openDisplay();
|
||||
|
||||
// check for peculiarities
|
||||
// FIXME -- may have to get these from some database
|
||||
m_capsLockHalfDuplex = false;
|
||||
// m_capsLockHalfDuplex = true;
|
||||
}
|
||||
|
||||
void CXWindowsPrimaryScreen::close()
|
||||
|
|
|
@ -43,6 +43,8 @@ class CXWindowsPrimaryScreen : public CXWindowsScreen, public IPrimaryScreen {
|
|||
CServer* m_server;
|
||||
bool m_active;
|
||||
Window m_window;
|
||||
|
||||
bool m_capsLockHalfDuplex;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue