All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heinrich Schuchardt <xypron.glpk@gmx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/2] usb: kbd: implement special keys
Date: Sun, 16 Jun 2019 23:43:39 +0200	[thread overview]
Message-ID: <20190616214339.26535-3-xypron.glpk@gmx.de> (raw)
In-Reply-To: <20190616214339.26535-1-xypron.glpk@gmx.de>

Provide support for F1-F12, Insert, Delete, Home, End, Page Up, Page Down.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 common/usb_kbd.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)

diff --git a/common/usb_kbd.c b/common/usb_kbd.c
index 232d278e13..c9ac7a9e4c 100644
--- a/common/usb_kbd.c
+++ b/common/usb_kbd.c
@@ -232,6 +232,60 @@ static int usb_kbd_translate(struct usb_kbd_pdata *data, unsigned char scancode,
 		debug("%c", keycode);

 	switch (scancode) {
+	case 0x3a:					/* F1 */
+		usb_kbd_put_sequence(data, "\eOP");
+		break;
+	case 0x3b:					/* F2 */
+		usb_kbd_put_sequence(data, "\eOQ");
+		break;
+	case 0x3c:					/* F3 */
+		usb_kbd_put_sequence(data, "\eOR");
+		break;
+	case 0x3d:					/* F4 */
+		usb_kbd_put_sequence(data, "\eOS");
+		break;
+	case 0x3e:					/* F5 */
+		usb_kbd_put_sequence(data, "\e[15~");
+		break;
+	case 0x3f:					/* F6 */
+		usb_kbd_put_sequence(data, "\e[17~");
+		break;
+	case 0x40:					/* F7 */
+		usb_kbd_put_sequence(data, "\e[18~");
+		break;
+	case 0x41:					/* F8 */
+		usb_kbd_put_sequence(data, "\e[19~");
+		break;
+	case 0x42:					/* F9 */
+		usb_kbd_put_sequence(data, "\e[20~");
+		break;
+	case 0x43:					/* F10 */
+		usb_kbd_put_sequence(data, "\e[21~");
+		break;
+	case 0x44:					/* F11 */
+		usb_kbd_put_sequence(data, "\e[23~");
+		break;
+	case 0x45:					/* F12 */
+		usb_kbd_put_sequence(data, "\e[24~");
+		break;
+	case 0x49:					/* INSERT */
+		usb_kbd_put_sequence(data, "\e[2~");
+		break;
+	case 0x4a:					/* HOME */
+		usb_kbd_put_sequence(data, "\e[H");
+		break;
+	case 0x4b:					/* PAGE UP */
+		usb_kbd_put_sequence(data, "\e[5~");
+		break;
+	case 0x4c:					/* DELETE */
+		usb_kbd_put_sequence(data, "\e[3~");
+		break;
+	case 0x4d:					/* END */
+		usb_kbd_put_sequence(data, "\e[F");
+		break;
+	case 0x4e:					/* PAGE DOWN */
+		usb_kbd_put_sequence(data, "\e[6~");
+		break;
 	case 0x4f:					/* Right arrow key */
 		usb_kbd_put_sequence(data, "\e[C");
 		break;
--
2.20.1

  parent reply	other threads:[~2019-06-16 21:43 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-16 21:43 [U-Boot] [PATCH 0/2] usb: kbd: implement special keys Heinrich Schuchardt
2019-06-16 21:43 ` [U-Boot] [PATCH 1/2] usb: kbd: simplify coding for arrow keys Heinrich Schuchardt
2019-06-24 13:56   ` Simon Glass
2019-06-24 17:36     ` Heinrich Schuchardt
2019-06-24 18:49       ` Simon Glass
2019-08-09 21:36         ` Heinrich Schuchardt
2019-08-13  9:34           ` Simon Glass
2019-06-16 21:43 ` Heinrich Schuchardt [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-02-22 12:04 [U-Boot] [PATCH 0/2] usb: kbd: implement special keys Heinrich Schuchardt
2018-02-22 12:04 ` [U-Boot] [PATCH 2/2] " Heinrich Schuchardt
2018-02-23 20:59   ` Simon Glass
2018-02-24 11:46     ` Heinrich Schuchardt
2018-03-08 22:04       ` Heinrich Schuchardt
2018-03-19 17:59         ` Simon Glass
2018-03-20  0:12           ` Tom Rini

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=20190616214339.26535-3-xypron.glpk@gmx.de \
    --to=xypron.glpk@gmx.de \
    --cc=u-boot@lists.denx.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.