-void OBActions::mapRequestHandler(const XMapRequestEvent &e)
-{
- doCallback(Action_NewWindow, e.window, (OBWidget::WidgetType)-1,
- 0, 0, 0, 0, 0);
+ // remove from the state the mask of the modifier being released, if it is
+ // a modifier key being released (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]; // remove 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::Release);