diff options
author | sabetts <sabetts> | 2003-05-25 07:06:20 +0000 |
---|---|---|
committer | sabetts <sabetts> | 2003-05-25 07:06:20 +0000 |
commit | 80406b0d4a10fd807be76df9eeabbd77af55e36e (patch) | |
tree | c074f814795ba9e44c70e5489c73812ca4c08a40 /src/input.c | |
parent | 671419ebfb5a6fa0937fd410b0b419f39cf7b25d (diff) | |
download | ratpoison-80406b0d4a10fd807be76df9eeabbd77af55e36e.zip |
(read_key): Do not wait for the key release
event. Remove gobble_rel argument. Callers updated.
Diffstat (limited to 'src/input.c')
-rw-r--r-- | src/input.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/src/input.c b/src/input.c index 94e2c9a..1cb370e 100644 --- a/src/input.c +++ b/src/input.c @@ -258,30 +258,19 @@ cook_keycode (XKeyEvent *ev, KeySym *keysym, unsigned int *mod, char *keysym_nam } int -read_key (KeySym *keysym, unsigned int *modifiers, char *keysym_name, int len, int gobble_rel) +read_key (KeySym *keysym, unsigned int *modifiers, char *keysym_name, int len) { XEvent ev; int nbytes; - unsigned int keycode; /* Read a key from the keyboard. */ do { XMaskEvent (dpy, KeyPressMask, &ev); - /* Store the keycode so we can wait for it's corresponding key - release event. */ - keycode = ev.xkey.keycode; *modifiers = ev.xkey.state; nbytes = cook_keycode (&ev.xkey, keysym, modifiers, keysym_name, len, 0); } while (IsModifierKey (*keysym)); - /* Gobble the release event for the key we pressed. */ - if (gobble_rel) - do - { - XMaskEvent (dpy, KeyReleaseMask, &ev); - } while (ev.xkey.keycode != keycode); - return nbytes; } @@ -369,7 +358,7 @@ get_more_input (char *prompt, char *preinput) /* XSync (dpy, False); */ - nbytes = read_key (&ch, &modifier, keysym_buf, keysym_bufsize, 0); + nbytes = read_key (&ch, &modifier, keysym_buf, keysym_bufsize); while (ch != XK_Return) { PRINT_DEBUG (("key %ld\n", ch)); @@ -441,7 +430,7 @@ get_more_input (char *prompt, char *preinput) update_input_window(s, prompt, str, cur_len); } - nbytes = read_key (&ch, &modifier, keysym_buf, keysym_bufsize, 0); + nbytes = read_key (&ch, &modifier, keysym_buf, keysym_bufsize); } str[cur_len] = 0; |