Bug 1237

Summary: setkeycodes doen't accept e0xx nor codes above 7f
Product: Busybox Reporter: Rodrigo Rivas Costa <rodrigorivascosta>
Component: OtherAssignee: unassigned
Status: RESOLVED FIXED    
Severity: minor CC: busybox-cvs
Priority: P5    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Host: Target:
Build:

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!