Bug 1237 - setkeycodes doen't accept e0xx nor codes above 7f
Summary: setkeycodes doen't accept e0xx nor codes above 7f
Status: RESOLVED FIXED
Alias: None
Product: Busybox
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: PC Linux
: P5 minor
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-03 17:14 UTC by Rodrigo Rivas Costa
Modified: 2010-05-19 15:16 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rodrigo Rivas Costa 2010-03-03 17:14:20 UTC
Doc says that "SCANCODE may be either xx or e0xx (hexadecimal)", but it only works with scancodes between 00 and 7f. The setkeycodes from coreutils accepts both the code above 7f and above e000

In 'console-tools/setkeycodes.c', line 37:

		a.scancode = sc = xstrtoul_range(argv[1], 16, 0, 255);
		if (a.scancode > 127) {
			a.scancode -= 0xe000;
			a.scancode += 128;
		}

I think it should be changed to something like this:

		a.scancode = sc = xstrtoul_range(argv[1], 16, 0, 0xe07f);
		if (a.scancode > 0xe000) {
			a.scancode -= 0xe000;
			a.scancode += 128;
		}

Sorry for not having the patch formatted, but I am copy-pasting manually from another machine...
Comment 1 Denys Vlasenko 2010-05-19 15:16:50 UTC
Fixed in git, will be in 1.17.0

Thanks for the report!