all repos — fluxbox @ b09aae8579d57defadaa39ebc5566ddb68799506

custom fork of the fluxbox windowmanager

changed caps lock detection to use LockMask, so the actual key can be used for Mod4, etc.
markt markt
commit

b09aae8579d57defadaa39ebc5566ddb68799506

parent

e89d4aa219461f9500ca6d5fb5ccedbfb28d7f64

3 files changed, 11 insertions(+), 10 deletions(-)

jump to
M ChangeLogChangeLog

@@ -1,5 +1,8 @@

(Format: Year/Month/Day) Changes for 1.0.0: +*07/04/05: + * Adjusted detection of Caps Lock key (Mark) + FbTk/KeyUtil.cc/hh *07/04/01: * Fixed a problem with windows being created in iconic state (Mark) Window.cc Screen.cc fluxbox.cc
M src/FbTk/KeyUtil.ccsrc/FbTk/KeyUtil.cc

@@ -62,7 +62,7 @@ }

KeyUtil::KeyUtil() - : m_modmap(0), m_capslock(0), m_numlock(0), m_scrolllock(0) + : m_modmap(0), m_numlock(0), m_scrolllock(0) { init(); }

@@ -93,9 +93,9 @@ KeySym ks = XKeycodeToKeysym(App::instance()->display(),

m_modmap->modifiermap[realkey], 0); switch (ks) { - case XK_Caps_Lock: - m_capslock = modlist[i].mask; - break; + // we just want to clean the Lock modifier, not specifically the + // XK_Caps_Lock key + // the others tend to vary from distro to distro, though case XK_Scroll_Lock: m_scrolllock = modlist[i].mask; break;

@@ -114,13 +114,12 @@ and with numlock,capslock and scrollock

*/ void KeyUtil::grabKey(unsigned int key, unsigned int mod, Window win) { Display *display = App::instance()->display(); - const unsigned int capsmod = instance().capslock(); const unsigned int nummod = instance().numlock(); const unsigned int scrollmod = instance().scrolllock(); // Grab with numlock, capslock and scrlock for (int i = 0; i < 8; i++) { - XGrabKey(display, key, mod | (i & 1 ? capsmod : 0) | + XGrabKey(display, key, mod | (i & 1 ? LockMask : 0) | (i & 2 ? nummod : 0) | (i & 4 ? scrollmod : 0), win, True, GrabModeAsync, GrabModeAsync); }

@@ -130,13 +129,12 @@

void KeyUtil::grabButton(unsigned int button, unsigned int mod, Window win, unsigned int event_mask, Cursor cursor) { Display *display = App::instance()->display(); - const unsigned int capsmod = instance().capslock(); const unsigned int nummod = instance().numlock(); const unsigned int scrollmod = instance().scrolllock(); // Grab with numlock, capslock and scrlock for (int i = 0; i < 8; i++) { - XGrabButton(display, button, mod | (i & 1 ? capsmod : 0) | + XGrabButton(display, button, mod | (i & 1 ? LockMask : 0) | (i & 2 ? nummod : 0) | (i & 4 ? scrollmod : 0), win, False, event_mask, GrabModeAsync, GrabModeAsync, None, cursor);
M src/FbTk/KeyUtil.hhsrc/FbTk/KeyUtil.hh

@@ -87,14 +87,14 @@ @return corresponding modifier mask

*/ static unsigned int keycodeToModmask(unsigned int keycode); int numlock() const { return m_numlock; } - int capslock() const { return m_capslock; } + int capslock() const { return LockMask; } int scrolllock() const { return m_scrolllock; } private: void loadModmap(); XModifierKeymap *m_modmap; - int m_capslock, m_numlock, m_scrolllock; + int m_numlock, m_scrolllock; static std::auto_ptr<KeyUtil> s_keyutil; };