[SLOF] [PATCH v2 1/2] Fix function keys on USB

Thomas Huth thuth at redhat.com
Fri Sep 11 22:13:12 AEST 2015


On 11/09/15 12:27, Thomas Huth wrote:
> On 10/09/15 12:55, Dinar valeev wrote:
>> From: Dinar Valeev <dvaleev at suse.com>
>>
>> This is fixing F1-F12 keys in grub2.
>>
>> Sequence was grabbed by running cat in xterm and pressing relative
>> function key.
>>
>> Signed-off-by: Dinar Valeev <dvaleev at suse.com>
>> ---
>>  lib/libusb/usb-hid.c | 28 ++++++++++++----------------
>>  1 file changed, 12 insertions(+), 16 deletions(-)
>>
>> diff --git a/lib/libusb/usb-hid.c b/lib/libusb/usb-hid.c
>> index 9d90006..5d1a4d4 100644
>> --- a/lib/libusb/usb-hid.c
>> +++ b/lib/libusb/usb-hid.c
>> @@ -214,33 +214,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;
> 
> Ok, according to
>  http://aperiodic.net/phil/archives/Geekery/term-function-keys.html
> you now switched from "vt100"-style function keys to "xterm"-style
> function keys

Of course I meant from "old xterm"-style to "new xterm/vt100"-style ...
this should IMHO be really OK since hardly anybody uses old xterm/rxvt
anymore these days.

 Thomas




More information about the SLOF mailing list