• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

system/core


Commit MetaInfo

Revision6d2050820549ff6ec3ae8e5232b98db064f840b9 (tree)
Zeit2011-07-07 02:51:15
AutorKyle Evans <kevans@andr...>
CommiterKyle Evans

Log Message

init: builtins: Update 'setkeycode'

Merge from gingerbread commit f815fcce7dfad2940d22846485478b8e18df4a3c.
Defer kc limit check to the kernel.

Ändern Zusammenfassung

Diff

--- a/init/builtins.c
+++ b/init/builtins.c
@@ -96,16 +96,6 @@ static int kbioctl(int cmd, void *data)
9696 return ret;
9797 }
9898
99-static int setkey(struct kbentry *kbe)
100-{
101- return kbioctl(KDSKBENT, kbe);
102-}
103-
104-static int setkeycode(struct kbkeycode *kbk)
105-{
106- return kbioctl(KDSETKEYCODE, kbk);
107-}
108-
10999 static int __ifupdown(const char *interface, int up)
110100 {
111101 struct ifreq ifr;
@@ -370,7 +360,7 @@ int do_setkey(int nargs, char **args)
370360 kbe.kb_table = strtoul(args[1], 0, 0);
371361 kbe.kb_index = strtoul(args[2], 0, 0);
372362 kbe.kb_value = strtoul(args[3], 0, 0);
373- return setkey(&kbe);
363+ return kbioctl(KDSKBENT, &kbe);
374364 }
375365
376366 int do_setkeycode(int nargs, char **args)
@@ -378,18 +368,15 @@ int do_setkeycode(int nargs, char **args)
378368 struct kbkeycode kbk;
379369 unsigned int sc, kc;
380370 sc = strtoul(args[1], 0, 0);
381- if (sc > 127) {
371+ if (sc >= 0xe000) {
382372 sc -= 0xe000;
383373 sc += 128;
384374 }
385375 kc = strtoul(args[2], 0, 0);
386- if (sc > 255 || kc > 127) {
387- ERROR("SCANCODE or KEYCODE out of range");
388- return -1;
389- }
390376 kbk.scancode = sc;
391377 kbk.keycode = kc;
392- return setkeycode(&kbk);
378+ /* sc, kc may be out of range, but we leave the testing to the kernel */
379+ return kbioctl(KDSETKEYCODE, &kbk);
393380 }
394381
395382 int do_setprop(int nargs, char **args)