summaryrefslogtreecommitdiff
path: root/src/actions.cc
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-02-11 09:52:24 +0000
committerDana Jansens <danakj@orodu.net>2003-02-11 09:52:24 +0000
commit6ae8608aede5e9972f19ea29ce1790a68a507ef9 (patch)
treeab1b315e32e5f3192fd42150cc6895e1cfa012a9 /src/actions.cc
parent5af3950710c00891c4508100d59301a6903c7b79 (diff)
make stacked cycling work without a modifier-key binding, i think. cleaner checking for modifiers in motion and stackedcycle.
Diffstat (limited to 'src/actions.cc')
-rw-r--r--src/actions.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/actions.cc b/src/actions.cc
index 3a7ff369..65931fc6 100644
--- a/src/actions.cc
+++ b/src/actions.cc
@@ -230,6 +230,26 @@ void Actions::keyPressHandler(const XKeyEvent &e)
// kill off the Button1Mask etc, only want the modifiers
unsigned int state = e.state & (ControlMask | ShiftMask | Mod1Mask |
Mod2Mask | Mod3Mask | Mod4Mask | Mod5Mask);
+
+ // add to the state the mask of the modifier being pressed, if it is
+ // a modifier key being pressed (this is a little ugly..)
+ const XModifierKeymap *map = otk::display->modifierMap();
+ const int mask_table[] = {
+ ShiftMask, LockMask, ControlMask, Mod1Mask,
+ Mod2Mask, Mod3Mask, Mod4Mask, Mod5Mask
+ };
+ KeyCode *kp = map->modifiermap;
+ for (int i = 0, n = sizeof(mask_table)/sizeof(mask_table[0]); i < n; ++i) {
+ for (int k = 0; k < map->max_keypermod; ++k) {
+ if (*kp == e.keycode) { // found the keycode
+ state |= mask_table[i]; // add the mask for it
+ i = n; // cause the first loop to break;
+ break; // get outta here!
+ }
+ ++kp;
+ }
+ }
+
openbox->bindings()->
fireKey(otk::display->findScreen(e.root)->screen(),
state, e.keycode, e.time, KeyAction::Press);