From: Peter Mamonov <pmamonov@gmail.com>
To: barebox@lists.infradead.org, s.hauer@pengutronix.de
Cc: Peter Mamonov <pmamonov@gmail.com>
Subject: [PATCH 2/2] input: usb keyboard: fix CTRL+C
Date: Sat, 20 Feb 2016 17:27:45 +0300 [thread overview]
Message-ID: <1455978465-28919-2-git-send-email-pmamonov@gmail.com> (raw)
In-Reply-To: <1455978465-28919-1-git-send-email-pmamonov@gmail.com>
Signed-off-by: Peter Mamonov <pmamonov@gmail.com>
---
drivers/input/input.c | 4 ++-
drivers/input/keymap.c | 82 ++++++++++++++++++++++++++++++++++++++++++++++++
include/input/keyboard.h | 1 +
3 files changed, 86 insertions(+), 1 deletion(-)
diff --git a/drivers/input/input.c b/drivers/input/input.c
index ad7400f..1c6891c 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -164,7 +164,9 @@ static void input_console_notify(struct input_notifier *in,
if (ic->modstate[4] || ic->modstate[5])
modstate |= 1 << 2;
- if (modstate & (1 << 0))
+ if (modstate & (1 << 1))
+ ascii = keycode_bb_ctrl_keys[ev->code];
+ else if (modstate & (1 << 0))
ascii = keycode_bb_shift_keys[ev->code];
else
ascii = keycode_bb_keys[ev->code];
diff --git a/drivers/input/keymap.c b/drivers/input/keymap.c
index 79ca461..90f1818 100644
--- a/drivers/input/keymap.c
+++ b/drivers/input/keymap.c
@@ -167,3 +167,85 @@ uint8_t keycode_bb_shift_keys[NR_KEYS] = {
[KEY_KPEQUAL] = '=',
[KEY_KPCOMMA] = ',',
};
+
+uint8_t keycode_bb_ctrl_keys[NR_KEYS] = {
+ [KEY_RESERVED] = 0xff,
+ [KEY_ESC] = 0x1b,
+ [KEY_1] = '1',
+ [KEY_2] = '2',
+ [KEY_3] = '3',
+ [KEY_4] = '4',
+ [KEY_5] = '5',
+ [KEY_6] = '6',
+ [KEY_7] = '7',
+ [KEY_8] = '8',
+ [KEY_9] = '9',
+ [KEY_0] = '0',
+ [KEY_MINUS] = '-',
+ [KEY_EQUAL] = '=',
+ [KEY_BACKSPACE] = 8,
+ [KEY_TAB] = '\t',
+ [KEY_Q] = 'q',
+ [KEY_W] = 'w',
+ [KEY_E] = 'e',
+ [KEY_R] = 'r',
+ [KEY_T] = 't',
+ [KEY_Y] = 'y',
+ [KEY_U] = 'u',
+ [KEY_I] = 'i',
+ [KEY_O] = 'o',
+ [KEY_P] = 'p',
+ [KEY_LEFTBRACE] = '[',
+ [KEY_RIGHTBRACE] = ']',
+ [KEY_ENTER] = '\n',
+ [KEY_A] = 'a',
+ [KEY_S] = 's',
+ [KEY_D] = 'd',
+ [KEY_F] = 'f',
+ [KEY_G] = 'g',
+ [KEY_H] = 'h',
+ [KEY_J] = 'j',
+ [KEY_K] = 'k',
+ [KEY_L] = 'l',
+ [KEY_SEMICOLON] = ';',
+ [KEY_APOSTROPHE] = '`',
+ [KEY_GRAVE] = '^',
+ [KEY_BACKSLASH] = '\\',
+ [KEY_Z] = 'z',
+ [KEY_X] = 'x',
+ [KEY_C] = 3,
+ [KEY_V] = 'v',
+ [KEY_B] = 'b',
+ [KEY_N] = 'n',
+ [KEY_M] = 'm',
+ [KEY_COMMA] = ',',
+ [KEY_DOT] = '.',
+ [KEY_SLASH] = '/',
+ [KEY_SPACE] = ' ',
+ [KEY_KP7] = '7',
+ [KEY_KP8] = '8',
+ [KEY_KP9] = '9',
+ [KEY_KPMINUS] = '-',
+ [KEY_KP4] = '4',
+ [KEY_KP5] = '5',
+ [KEY_KP6] = '6',
+ [KEY_KPPLUS] = '+',
+ [KEY_KP1] = '1',
+ [KEY_KP2] = '2',
+ [KEY_KP3] = '3',
+ [KEY_KP0] = '0',
+ [KEY_KPDOT] = '.',
+ [KEY_KPENTER] = '\n',
+ [KEY_HOME] = BB_KEY_HOME,
+ [KEY_UP] = BB_KEY_UP,
+ [KEY_PAGEUP] = BB_KEY_PAGEUP,
+ [KEY_LEFT] = BB_KEY_LEFT,
+ [KEY_RIGHT] = BB_KEY_RIGHT,
+ [KEY_END] = BB_KEY_END,
+ [KEY_DOWN] = BB_KEY_DOWN,
+ [KEY_PAGEDOWN] = BB_KEY_PAGEDOWN,
+ [KEY_INSERT] = BB_KEY_INSERT,
+ [KEY_DELETE] = BB_KEY_DEL,
+ [KEY_KPEQUAL] = '=',
+ [KEY_KPCOMMA] = ',',
+};
diff --git a/include/input/keyboard.h b/include/input/keyboard.h
index d1f5bf5..8ccdf31 100644
--- a/include/input/keyboard.h
+++ b/include/input/keyboard.h
@@ -7,5 +7,6 @@
extern uint8_t keycode_bb_keys[NR_KEYS];
extern uint8_t keycode_bb_shift_keys[NR_KEYS];
+extern uint8_t keycode_bb_ctrl_keys[NR_KEYS];
#endif
--
2.1.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2016-02-20 14:25 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-20 14:27 [PATCH 1/2] input: usb keyboard: fix BACKSPACE Peter Mamonov
2016-02-20 14:27 ` Peter Mamonov [this message]
2016-02-20 16:51 ` [PATCH 2/2] input: usb keyboard: fix CTRL+C Sam Ravnborg
2016-02-23 7:55 ` Sascha Hauer
2016-02-24 10:48 ` [PATCH v2] " Peter Mamonov
2016-02-24 14:21 ` Antony Pavlov
2016-02-24 15:07 ` Peter Mamonov
2016-02-24 18:12 ` Sascha Hauer
2016-02-24 18:53 ` Trent Piepho
2016-02-25 6:05 ` Sascha Hauer
2016-02-25 10:15 ` Peter Mamonov
2016-02-25 10:05 ` [PATCH v3] input: usb keyboard: fix CTRL+ combinations Peter Mamonov
2016-02-26 6:52 ` Sascha Hauer
2016-02-23 7:50 ` [PATCH 1/2] input: usb keyboard: fix BACKSPACE Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1455978465-28919-2-git-send-email-pmamonov@gmail.com \
--to=pmamonov@gmail.com \
--cc=barebox@lists.infradead.org \
--cc=s.hauer@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox