all repos — openbox @ fdc52e879f11166186014ebb2bac7121edf08e79

openbox fork - make it a bit more like ryudo

add the chainQuitKey option to teh <keyboard> section of the rc3
Dana Jansens danakj@orodu.net
commit

fdc52e879f11166186014ebb2bac7121edf08e79

parent

83705e52c469444de38bb676c097d175e66928a7

4 files changed, 32 insertions(+), 0 deletions(-)

jump to
M data/rc3data/rc3

@@ -53,6 +53,8 @@ <hideTimeout>300</hideTimeout>

</dock> <keyboard> + <chainQuitKey>C-g</chainQuitKey> + <keybind key="A-F10"> <action name="MaximizeFull"></action> </keybind>
M openbox/config.copenbox/config.c

@@ -2,6 +2,7 @@ #include "config.h"

#include "keyboard.h" #include "mouse.h" #include "prop.h" +#include "translate.h" #include "parser/parse.h" gboolean config_focus_new;

@@ -29,6 +30,9 @@ ObOrientation config_dock_orient;

gboolean config_dock_hide; guint config_dock_hide_timeout; +guint config_keyboard_reset_keycode; +guint config_keyboard_reset_state; + gint config_mouse_threshold; gint config_mouse_dclicktime;

@@ -48,6 +52,12 @@ char *key;

ObAction *action; xmlNodePtr n, nact; GList *it; + + if ((n = parse_find_node("chainQuitKey", node))) { + key = parse_string(doc, n); + translate_key(key, &config_keyboard_reset_state, + &config_keyboard_reset_keycode); + } n = parse_find_node("keybind", node); while (n) {

@@ -342,6 +352,9 @@ config_dock_hide = FALSE;

config_dock_hide_timeout = 3000; parse_register("dock", parse_dock, NULL); + + translate_key("C-g", &config_keyboard_reset_state, + &config_keyboard_reset_keycode); parse_register("keyboard", parse_keyboard, NULL);
M openbox/config.hopenbox/config.h

@@ -54,6 +54,11 @@ extern int config_desktops_num;

/*! Names for the desktops */ extern GSList *config_desktops_names; +/*! The keycode of the key combo which resets the keybaord chains */ +guint config_keyboard_reset_keycode; +/*! The modifiers of the key combo which resets the keybaord chains */ +guint config_keyboard_reset_state; + /*! Number of pixels a drag must go before being considered a drag */ extern gint config_mouse_threshold; /*! Number of milliseconds within which 2 clicks must occur to be a
M openbox/keyboard.copenbox/keyboard.c

@@ -8,6 +8,7 @@ #include "client.h"

#include "action.h" #include "prop.h" #include "timer.h" +#include "config.h" #include "keytree.h" #include "keyboard.h" #include "translate.h"

@@ -36,6 +37,10 @@ while (p) {

grab_key(p->key, p->state, win, GrabModeAsync); p = p->next_sibling; } + if (curpos) + grab_key(config_keyboard_reset_keycode, + config_keyboard_reset_state, + win, GrabModeAsync); } }

@@ -178,6 +183,13 @@ {

KeyBindingTree *p; g_assert(e->type == KeyPress); + + if (e->xkey.keycode == config_keyboard_reset_keycode && + e->xkey.state == config_keyboard_reset_state) + { + keyboard_reset_chains(); + return; + } if (curpos == NULL) p = keyboard_firstnode;