diff options
author | sabetts <sabetts> | 2000-11-27 10:07:47 +0000 |
---|---|---|
committer | sabetts <sabetts> | 2000-11-27 10:07:47 +0000 |
commit | 4d5c1a6c9a9aef8e3386d2a643e7ce4f9e44f201 (patch) | |
tree | bf0fd6de6018b6efc901e08ca5eaefe5d7e55233 /src/actions.c | |
parent | 87283e809fe6377b7991c98a09de72247b71936d (diff) | |
download | ratpoison-4d5c1a6c9a9aef8e3386d2a643e7ce4f9e44f201.zip |
fixed some problems with modifiers for key events
Diffstat (limited to 'src/actions.c')
-rw-r--r-- | src/actions.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/actions.c b/src/actions.c index e9e0867..09e5bd2 100644 --- a/src/actions.c +++ b/src/actions.c @@ -7,7 +7,8 @@ #include "ratpoison.h" /* Initialization of the key structure */ -rp_action key_actions[] = { {'c', -1, "xterm", spawn}, +rp_action key_actions[] = { {KEY_PREFIX, 0, 0, generate_prefix}, + {'c', -1, "xterm", spawn}, {'e', -1, "emacs", spawn}, {'p', -1, 0, prev_window}, {'n', -1, 0, next_window}, @@ -18,6 +19,7 @@ rp_action key_actions[] = { {'c', -1, "xterm", spawn}, {'k', 0, 0, delete_window}, {'\'', -1, 0, goto_win_by_name}, {'a', -1, 0, rename_current_window}, + {'g', ControlMask, 0, abort_keypress}, {'0', -1, 0, goto_window_0}, {'1', -1, 0, goto_window_1}, {'2', -1, 0, goto_window_2}, @@ -256,3 +258,22 @@ toggle_bar (void *data) if (!hide_bar (s)) show_bar (s); } } + + +void +abort_keypress (void *data) +{ +} + +/* Send the current window the prefix key event */ +void +generate_prefix (void *data) +{ + XEvent ev; + ev = *rp_current_event; + + ev.xkey.window = rp_current_window->w; + ev.xkey.state = MODIFIER_PREFIX; + XSendEvent (dpy, rp_current_window->w, False, KeyPressMask, &ev); + XSync (dpy, False); +} |