All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
To: Dinar valeev <k0da@opensuse.org>, linuxppc-dev@lists.ozlabs.org
Cc: Dinar Valeev <dvaleev@suse.com>
Subject: Re: [PATCH] Fix function keys sequence on USB
Date: Mon, 06 Jul 2015 13:28:07 +0530	[thread overview]
Message-ID: <873811ra40.fsf@linux.vnet.ibm.com> (raw)
In-Reply-To: <1432906201-25009-1-git-send-email-k0da@opensuse.org>

Dinar valeev <k0da@opensuse.org> writes:

> From: Dinar Valeev <dvaleev@suse.com>
>
> Original issue is home and end keys are not functional in grub2.
> Later I've found other inconsistencies in f1-f12 keys.
>
> "Correct sequence" was crabbed by pressing key on cat running in
> xterm.
>
> Tested with Home, End, F2, Del and F10 keys in grub2

Few observations with more testing:

* In console mode F2 and F10 both are interpreted as ESC.
* In VNC F2 works fine F10 does not.

I would suggest to drop the "Fn" related changes and resend this patch
with END/HOME. As Ctrl-c and Ctrl-x both works as expected in the grub
edit mode.

>
> Signed-off-by: Dinar Valeev <dvaleev@suse.com>
> ---
>  lib/libusb/usb-hid.c | 40 +++++++++++++++++-----------------------
>  1 file changed, 17 insertions(+), 23 deletions(-)
>
> diff --git a/lib/libusb/usb-hid.c b/lib/libusb/usb-hid.c
> index f0cab8a..ccd5ba9 100644
> --- a/lib/libusb/usb-hid.c
> +++ b/lib/libusb/usb-hid.c
> @@ -190,33 +190,29 @@ static void check_key_code(uint8_t *buf)
>  				case 0x3a:	                        /* F1 */
>  					write_key(0x1b);
>  					write_key(0x5b);
> -					write_key(0x31);
> -					write_key(0x31);
> -					write_key(0x7e);
> +					write_key(0x4f);
> +					write_key(0x50);
>  					break;
>  
>  				case 0x3b:		                /* F2 */
>  					write_key(0x1b);
>  					write_key(0x5b);
> -					write_key(0x31);
> -					write_key(0x32);
> -					write_key(0x7e);
> +					write_key(0x4f);
> +					write_key(0x51);
>  					break;
>  
>  				case 0x3c:
>  					write_key(0x1b);               /* F3 */
>  					write_key(0x5b);
> -					write_key(0x31);
> -					write_key(0x33);
> -					write_key(0x7e);
> +					write_key(0x4f);
> +					write_key(0x52);
>  					break;
>  
>  				case 0x3d:
>  					write_key(0x1b);		/* F4 */
>  					write_key(0x5b);
> -					write_key(0x31);
> -					write_key(0x34);
> -					write_key(0x7e);
> +					write_key(0x4f);
> +					write_key(0x53);
>  					break;
>  
>  				case 0x3e:
> @@ -254,7 +250,7 @@ static void check_key_code(uint8_t *buf)
>  				case 0x42:
>  					write_key(0x1b);		/* F9 */
>  					write_key(0x5b);
> -					write_key(0x31);
> +					write_key(0x32);
>  					write_key(0x30);
>  					write_key(0x7e);
>  					break;
> @@ -262,7 +258,7 @@ static void check_key_code(uint8_t *buf)
>  				case 0x43:
>  					write_key(0x1b);	       /* F10 */
>  					write_key(0x5b);
> -					write_key(0x31);
> +					write_key(0x32);
>  					write_key(0x31);
>  					write_key(0x7e);
>  					break;
> @@ -270,7 +266,7 @@ static void check_key_code(uint8_t *buf)
>  				case 0x44:
>  					write_key(0x1b);	       /* F11 */
>  					write_key(0x5b);
> -					write_key(0x31);
> +					write_key(0x32);
>  					write_key(0x33);
>  					write_key(0x7e);
>  					break;
> @@ -278,7 +274,7 @@ static void check_key_code(uint8_t *buf)
>  				case 0x45:
>  					write_key(0x1b);	       /* F12 */
>  					write_key(0x5b);
> -					write_key(0x31);
> +					write_key(0x32);
>  					write_key(0x34);
>  					write_key(0x7e);
>  					break;
> @@ -290,36 +286,34 @@ static void check_key_code(uint8_t *buf)
>  				case 0x49:
>  					write_key(0x1b);	       /* INS */
>  					write_key(0x5b);
> -					write_key(0x31);
> +					write_key(0x32);
>  					write_key(0x7e);
>  					break;
>  
>  				case 0x4a:
>  					write_key(0x1b);	      /* HOME */
>  					write_key(0x5b);
> -					write_key(0x32);
> -					write_key(0x7e);
> +					write_key(0x48);
>  					break;
>  
>  				case 0x4b:
>  					write_key(0x1b);	      /* PgUp */
>  					write_key(0x5b);
> -					write_key(0x33);
> +					write_key(0x35);
>  					write_key(0x7e);
>  					break;
>  
>  				case 0x4c:
>  					write_key(0x1b);	       /* DEL */
>  					write_key(0x5b);
> -					write_key(0x34);
> +					write_key(0x33);
>  					write_key(0x7e);
>  					break;
>  
>  				case 0x4d:
>  					write_key(0x1b);	       /* END */
>  					write_key(0x5b);
> -					write_key(0x35);
> -					write_key(0x7e);
> +					write_key(0x46);
>  					break;
>  
>  				case 0x4e:
> -- 
> 2.1.4
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev

  parent reply	other threads:[~2015-07-06  8:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-29 13:30 [PATCH] Fix function keys sequence on USB Dinar valeev
2015-05-30  9:59 ` [PATCH slof] " Alexey Kardashevskiy
2015-05-30 19:21   ` Dinar Valeev
2015-06-02  9:47 ` [PATCH] " Nikunj A Dadhania
2015-06-02 10:05   ` Dinar Valeev
2015-06-02 10:29     ` Nikunj A Dadhania
2015-06-02 10:43       ` Dinar Valeev
2015-06-02 11:12         ` Thomas Huth
2015-06-02 11:17           ` Dinar Valeev
2015-07-06  7:58 ` Nikunj A Dadhania [this message]
2015-09-01 14:13 ` Thomas Huth
2015-09-01 14:48   ` Dinar Valeev
2015-09-01 15:08     ` Thomas Huth

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=873811ra40.fsf@linux.vnet.ibm.com \
    --to=nikunj@linux.vnet.ibm.com \
    --cc=dvaleev@suse.com \
    --cc=k0da@opensuse.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    /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.