[SLOF] [PATCH] usb-hid: Fix non-working comma key

Alexey Kardashevskiy aik at ozlabs.ru
Mon Jul 25 15:00:17 AEST 2016


On 14/07/16 21:43, Thomas Huth wrote:
> Commit c8bd0cdce2bd ("Caps is not always shift") introduced
> a global "ctrl" variable and two new cases to handle the shift
> key in check_key_code() in usb-hid.c. However, one of these cases
> uses the key code for the "," key and thus prevents that key
> from working in the VGA console. The global ctrl variable that
> is set by these two cases is never read again, so this is
> apparently completely useless code, likely just an accidential
> leftover from debugging the original issue. So let's simply
> remove that bad code to get the comma key working again.
> 
> Fixes: c8bd0cdce2bd7c4498d61079553c89747656614d
> Signed-off-by: Thomas Huth <thuth at redhat.com>



Thanks, applied.


> ---
>  lib/libusb/usb-hid.c | 7 -------
>  1 file changed, 7 deletions(-)
> 
> diff --git a/lib/libusb/usb-hid.c b/lib/libusb/usb-hid.c
> index ac6616a..1ea9ff2 100644
> --- a/lib/libusb/usb-hid.c
> +++ b/lib/libusb/usb-hid.c
> @@ -87,7 +87,6 @@ uint8_t set_leds;
>  const uint8_t *key_std       = NULL;
>  const uint8_t *key_std_shift = NULL;
>  
> -uint8_t ctrl; /* modifiers */
>  
>  /**
>   * read character from Keyboard-Buffer
> @@ -205,12 +204,6 @@ static void check_key_code(uint8_t *buf)
>  					set_leds ^= LED_CAPS_LOCK;
>  					break;
>  
> -				case 0x36:		                /*Shift pressed*/
> -					ctrl |= MODIFIER_SHIFT;
> -					break;
> -				case 0xb6:		                /*Shift unpressed*/
> -					ctrl &= ~MODIFIER_SHIFT;
> -					break;
>  				case 0x3a:	                        /* F1 */
>  					write_key(0x1b);
>  					write_key(0x5b);
> 


-- 
Alexey


More information about the SLOF mailing list