diff options
author | Arthur Taylor <art@ified.ca> | 2011-02-05 00:55:50 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-02-17 22:12:40 +0300 |
commit | 9fc3de9c83565fcaa23df74c2fc414bb6e7efb0a (patch) | |
tree | 8d5fb1f8b90fb9a4f194aee8971859a45283d88c /drivers/tty/vt/keyboard.c | |
parent | 8e6d3fe1af38bea3f6c003f8737d2e3a02d00fa0 (diff) | |
download | linux-9fc3de9c83565fcaa23df74c2fc414bb6e7efb0a.tar.xz |
vt: Add virtual console keyboard mode OFF
virtual console: add keyboard mode OFF
Add a new mode for the virtual console keyboard OFF in which all input
other than shift keys is ignored. Prevents vt input buffers from
overflowing when a program opens but doesn't read from a tty, like X11
using evdev for input.
Signed-off-by: Arthur Taylor <art@ified.ca>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/tty/vt/keyboard.c')
-rw-r--r-- | drivers/tty/vt/keyboard.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/tty/vt/keyboard.c b/drivers/tty/vt/keyboard.c index e95d7876ca6b..6dd3c68c13ad 100644 --- a/drivers/tty/vt/keyboard.c +++ b/drivers/tty/vt/keyboard.c @@ -654,7 +654,8 @@ static void k_spec(struct vc_data *vc, unsigned char value, char up_flag) if (value >= ARRAY_SIZE(fn_handler)) return; if ((kbd->kbdmode == VC_RAW || - kbd->kbdmode == VC_MEDIUMRAW) && + kbd->kbdmode == VC_MEDIUMRAW || + kbd->kbdmode == VC_OFF) && value != KVAL(K_SAK)) return; /* SAK is allowed even in raw mode */ fn_handler[value](vc); @@ -1295,7 +1296,7 @@ static void kbd_keycode(unsigned int keycode, int down, int hw_raw) if (rc == NOTIFY_STOP) return; - if (raw_mode && type != KT_SPEC && type != KT_SHIFT) + if ((raw_mode || kbd->kbdmode == VC_OFF) && type != KT_SPEC && type != KT_SHIFT) return; (*k_handler[type])(vc, keysym & 0xff, !down); |