Revision: 5892
Author: pebender
Date: Tue Dec  1 23:35:22 2009
Log: - Improved the fix for LIRC's uinput key codes.


http://code.google.com/p/minimyth/source/detail?r=5892

Modified:
  /trunk/gar-minimyth/script/system/lirc/checksums
   
/trunk/gar-minimyth/script/system/lirc/files/lirc-0.8.6-uinput_key_fix.patch

=======================================
--- /trunk/gar-minimyth/script/system/lirc/checksums    Mon Nov 30 19:50:21  
2009
+++ /trunk/gar-minimyth/script/system/lirc/checksums    Tue Dec  1 23:35:22  
2009
@@ -1,4 +1,4 @@
  4ca24da6f5e7c2dcea74878c27a4a3f7  download/lirc-0.8.6.tar.bz2
-6f354391da71991c7b730c5644829908  download/lirc-0.8.6-uinput_key_fix.patch
+a91f175b0cfe968099a7a3623a1a8b36  download/lirc-0.8.6-uinput_key_fix.patch
  f848f08622360d1714dc2f9e91934bab   
download/lirc-0.8.6-remove_smp_unsafe_drivers.patch
  2bec5f74b2ecd993afad4572607e4c9b  download/lirc-0.8.6-input_map.patch.gar
=======================================
---  
/trunk/gar-minimyth/script/system/lirc/files/lirc-0.8.6-uinput_key_fix.patch    
 
Mon Nov 30 19:50:21 2009
+++  
/trunk/gar-minimyth/script/system/lirc/files/lirc-0.8.6-uinput_key_fix.patch    
 
Tue Dec  1 23:35:22 2009
@@ -1,12 +1,69 @@
+diff -Naur lirc-0.8.6-old/daemons/input_map.c  
lirc-0.8.6-new/daemons/input_map.c
+--- lirc-0.8.6-old/daemons/input_map.c 2008-10-26 08:10:17.000000000 -0700
++++ lirc-0.8.6-new/daemons/input_map.c 2009-12-01 20:57:41.000000000 -0800
+@@ -25,6 +25,21 @@
+       {NULL, 0}
+ };
+
++int get_input_code_by_index(int index, linux_input_code *code)
++{
++      int i;
++
++      for (i=0; input_map[i].name != NULL; i++)
++      {
++              if (i == index)
++              {
++                      *code = input_map[i].code;
++                      return i;
++              }
++      }
++      return -1;
++}
++
+ int get_input_code(const char *name, linux_input_code *code)
+ {
+       int i;
+diff -Naur lirc-0.8.6-old/daemons/input_map.h  
lirc-0.8.6-new/daemons/input_map.h
+--- lirc-0.8.6-old/daemons/input_map.h 2008-10-26 08:10:17.000000000 -0700
++++ lirc-0.8.6-new/daemons/input_map.h 2009-12-01 20:57:41.000000000 -0800
+@@ -28,6 +28,7 @@
+ typedef unsigned short linux_input_code;
+ #endif
+
++int get_input_code_by_index(int index, linux_input_code *code);
+ int get_input_code(const char *name, linux_input_code *code);
+ void fprint_namespace(FILE *f);
+ int is_in_namespace(const char *name);
  diff -Naur lirc-0.8.6-old/daemons/lircd.c lirc-0.8.6-new/daemons/lircd.c
  --- lirc-0.8.6-old/daemons/lircd.c    2009-08-29 00:46:44.000000000 -0700
-+++ lirc-0.8.6-new/daemons/lircd.c     2009-11-29 14:01:21.000000000 -0800
-@@ -445,7 +445,7 @@
++++ lirc-0.8.6-new/daemons/lircd.c     2009-12-01 20:57:51.000000000 -0800
+@@ -417,6 +417,8 @@
+ #if defined(__linux__)
+       int fd;
+       int key;
++      linux_input_code code;
++      int i;
+       struct uinput_user_dev dev;
+
+       fd = open("/dev/input/uinput", O_RDWR);
+@@ -445,12 +447,16 @@
                goto setup_error;
        }

  -        for(key = KEY_RESERVED; key <= KEY_UNKNOWN; key++)
-+        for(key = 0; key <= KEY_MAX; key++)
-       {
-                 if(ioctl(fd, UI_SET_KEYBIT, key) != 0)
-               {
++      for(i = 0; get_input_code_by_index(i, &code) >= 0; i++)
+       {
+-                if(ioctl(fd, UI_SET_KEYBIT, key) != 0)
++              key = (int)code;
++              if ((key < BTN_MISC) || (key > BTN_GEAR_UP))
+               {
+-                      goto setup_error;
+-                }
++                      if(ioctl(fd, UI_SET_KEYBIT, key) != 0)
++                      {
++                              goto setup_error;
++                      }
++              }
+       }
+
+       if(ioctl(fd, UI_DEV_CREATE) != 0)

--

You received this message because you are subscribed to the Google Groups 
"minimyth-commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/minimyth-commits?hl=en.


Reply via email to