Announcement

Collapse
No announcement yet.

Help How to Config Multi Button Wireless Mouse MX1100-Karmic 910

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Help How to Config Multi Button Wireless Mouse MX1100-Karmic 910

    Hello!
    PLEASE, apologies for the long post, but I try to include info, links and howtos in order to help and may quick understanding of several issues that i already tested or may be I made bad, to save time to others that may have the same kind of trouble.Thanks for Your kind patience and attention.

    I Would like to ask for help with this detail, since by now, I spend my free time over the last week and never get the mouse working.Since the info that is already available is some what confused and also was wrote for the previous versions of ubuntu, the things dont seems clear to me, now that there is HAL, also in some places said that Karmic HAL implementations dont read or take care of user made fdi config files, and by other side talks about make HAL to use an previous way by means of a xorg.conf file.

    Well, by now, I am very confused and somewhat frustrated, so, I would like to ask for the kind help of people around here that may have the skills and time to provide some clear instuctions (any help is welcome, but I am very gratefull, if could be write for a common user with some very basic linux knowledge base...please).

    I hope that will not bother too much, and apologizee if this post is somewhat long, but in order to help other and may be with the solution, I will try to provide the rough points between lots of tries that I was following until the point that I was knocked that I was not able to make the things working.

    I would like to make my mouse working in a standard way, except that I like to make the 10 buttons of the MX1100 working, so the buttons almost all works as are recognized by firefox in a plane instalation of Kubuntu Karmic, plus make the SIDE THUMB buttons 8 and 9 working as previous/back page in ALL apps (after install they are ONLY recongnized inside Firefox), plus adding the setting for Button 2 (button by pressing the wheel down) and button 10 (Hide Button under the mouse base lip for the Thumb), to make CTRL+(+) and CTRL+(-) (zoom in/out) function in all KDE and others apps working. Previously, I made this on Mepis 8 working in that way and in the botton I will add a copy of a poor howto that I wrote to rememnber whay I did. I tried to remke it in Kubuntu 9.10, but there are so many things that change or may be I am not skill to acomplish but I didnt make it working so, I will resume the details that where stopping me:

    1)I first try to make a fdi config file, butt soon I found the show stoppers:

    1.a) Seems that Karmic may ignore fdi config files as Setting options via HAL, and may not work in Ubuntu 9.10 by default, as is mention on this link:

    https://help.ubuntu.com/community/Lo...arblemouse_USB

    I tried also in Xubuntu Karmic test tipical install, the workaround by disabling the mouse plugin of gnome-settings-daemon is described at http://bbs.archlinux.org/viewtopic.php?pid=644304. in order to look if the HAL at least try to make something diferent to my mouse (I even tried to make some weird config in buttons or wheel movement in order to look for HAL make some changes under control of my mod fdi files) but Nothing happen.

    2)Then I tried to use xinput to make the settings and think about to a script run at the begining in order to make thigs set at boot, but later I found that xinput indetifies the remote wireless adapter of the mouse as a combo unit for manage both a wireless mouse (that I have a MX1100) and a wireless keyboard ( That I don have BUT the original apadter seems that was made for manage both a keyboard and an mouse in wireless), so, BOTH options are enable ven if there no wireless keyboard present, and BOTH are named as "Logitech USB Receiver".

    So xinput is not able to separate by name the both options, and said that may be try to use iD for diference to which device I want to send settings, BUT didn t find any example over internet about how to use xinput with using an id device number instead a device name that are all the example that I found, so in this point I could not do more. If I found the correct syntax to make xinput to recognized and set settings fo a device by the id=xx number that xinput reports with command xinput list, may be possible to separate both wiresless devices.

    3) In the middle I also tried to bolck the implementation of macintosh mouse emulatuion, that karmic made, since some other links talks about it may interfere or fixed the settings of other mice connected, so I tried also blacklisted the macintosh mouse, like the info of this link, only in my desperate quest for find what is the factor that dont allow config form HAL:

    http://bbs.archlinux.org/viewtopic.php?id=60986

    4)Finally I found some info about make new Karmic Xorg to generate a xorg.conf file, the edit it and make it run like the old configuration way. well, I found this link:

    http://ubuntuforums.org/showthread.php?t=1325212

    I made t, I edited it like my old Mepis xorg.conf settings, and try... and now I have my kubuntu install frozen... well, this is not the problem since I may reinstall it, But I am seriously frustrated after checkig all the ways possible and in the middle checking LOTS of other links related that talks about that HAL implemetations over Karmic is buggy and unsolved, that HAL will be substituted in Lucid, that many stuff like HAL syntax may vary in the fdi config files that may be used, about that may be some hidden/fixed settings that make HAL in Karmic simly not able to read config fdi files, that now I simply Lost.... :-P

    So, Please, I would like to ask favor help from some people with real skills, that may know what may be happen, and what may be the better rout to fix config the mouse 10 buttons working.
    a) Try to make HAL recognized fdi files, and a example fdi config file with the correct syntax fields settings for HAL in karmnic that may allow to recognized, and map 10 buttons.

    b) Try to make HAL to use a xorg.conf file, with the old settings, and may which could the the exact tweaks that may be need to make to a plain new Kubuntu install to make HAL to use xorg.conf, instaed to rty to use fdi, and also, if possible an xorg.conf with the correct new syntax that may be requeired for the new Xorg vrsion in Karmic.

    As if may help others, I copy below the crappy howto that I used in the past to config the MX1100 with the 10 buttons in Mepis 8, if may help others or with the solution:
    ------------------------------------------------------------------------------------------
    HOWTO Config Multi buttons Mouse MEPiS 8 (Logitech MX 1100)

    There are so many cross & outdated info in internet that config
    a multi buttons mouse is a real pain, so i would like to share
    the tips that I found after long hours of work that allow me
    finally config well the mouse MX1100

    1)For find the event that is associated to the mouse (and may be keyboard circuit) in the wireless receiver,for checking the events, use the command:

    cat -v /proc/bus/input/devices

    and it will show this type of results:

    I: Bus=0003 Vendor=046d Product=c526 Version=0111
    N: Name="Logitech USB Receiver"
    P: Phys=usb-0000:00:1d.0-1/input0
    S: Sysfs=/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1:1.0/input/input6
    U: Uniq=
    H: Handlers=mouse2 event6
    B: EV=17
    B: KEY=ffff0000 0 0 0 0 0 0 0 0
    B: REL=143
    B: MSC=10

    I: Bus=0003 Vendor=046d Product=c526 Version=0111
    N: Name="Logitech USB Receiver"
    P: Phys=usb-0000:00:1d.0-1/input1
    S: Sysfs=/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1:1.1/input/input7
    U: Uniq=
    H: Handlers=kbd event7
    B: EV=1f
    B: KEY=837fff 2c3027 bf004444 0 0 1 f84 8a27c000 667bfa d9415fed 8e0000 0 0 0
    B: REL=40
    B: ABS=1 0
    B: MSC=10

    2) So, like the receiver have almost same data for mouse and kyb, the nightmare is found a way to indentify the mouse form the keyb, since appears that in MEPiS 8 is needed to amke a new rules file to fix the event in a way that didnt change every boot of the machine (event number may change in every boo or if you unplug some usb device), so is a must to look for additional specific fields in devices system:

    Using command (for event6 that is mouse):

    udevinfo -a -p `udevinfo -q path -n /dev/input/event6` | grep modalias

    give this results:

    ATTRS{modalias}=="input:b0003v046DpC526e0111-e0,1,2,4,k110,111,112,113,114,115,116,117,118,119, 11A,11B,11C,11D,11E,11F,r0,1,6,8,am4,lsfw"
    ATTRS{modalias}=="usb:v046DpC526d0500dc00dsc00dp00 ic03isc01ip02"
    ATTRS{modalias}=="pci:v00008086d000024D2sv0000103C sd0000006Abc0Csc03i00"

    and using the same command for event7 (this is of the keyb that appears in USB receiver):

    udevinfo -a -p `udevinfo -q path -n /dev/input/event7` | grep modalias

    The results are:

    ATTRS{modalias}=="usb:v046DpC526d0500dc00dsc00dp00 ic03isc00ip00"
    ATTRS{modalias}=="pci:v00008086d000024D2sv0000103C sd0000006Abc0Csc03i00"

    3) The only way that I found was to make a rules file using the ATTRS{modalias}=="usb:value in a new rules file that I name 010_local.rules
    and made it with Kwrite in the path: /etc/udev/rules.d/

    kwrite /etc/udev/rules.d/010_local.rules

    and inside I use for my mouse the code:

    SUBSYSTEM=="input", KERNEL=="event*", BUS=="usb", SYSFS{modalias}=="usb:v046DpC526d0500dc00dsc00dp00 ic03isc01ip02", SYMLINK+="input/mx1100"

    4) After save You could use the following command to restart the udev, and the previous rules, would make a new input device named mx1100

    To restart udev (for checking is the rules are well recognized):

    sudo /etc/init.d/udev restart

    5) After restart You could Check if its device node is there withe the command:

    ls /dev/input/

    (results must be something like:
    by-id by-path event0 event1 event2 event3 event4 event5 event6 event7 event8 event9 mice mouse0 mouse1 mouse2 mx1100

    this result is when the rules 010_MX1100.rules is well recognized, if not the mx1100 device (or the name that You use for define it in rules) You should revise the previous steps before continue because if not is almost sure Youc could not get the mouse later recognized by xorg.conf.

    6) After that You could use a little command (that is neede to copy and paste it as a new text file, with name evdev-key-btn-test.c to compile the utility with teh command:

    gcc -o evdev-key-btn-test evdev-key-btn-test.c

    Then You can see the event device at the Handler and test it with this utility,
    and run it with the following command

    evdev-key-btn-test /dev/input/mx1100

    and it should show some results of the keys and info about the mouse recognized

    (You could use also evdev-key-btn-test /dev/input/eventX where X = input device number or if to try to debug how is the mouse event recognized in order to try to make rules working, at the end below I copy the code of the utility in order that the post will be complete in resources)

    7) If the device mx1100 is properly working after steps 1 to 6 then You edit Your xorg .conf according and I copy the important parts form mine that is working by now:


    Section "ServerLayout"
    Identifier "XFree86 Configured"
    Screen 0 "Screen0" 0 0
    InputDevice "Keyboard0" "CoreKeyboard"
    InputDevice "MX1100" "CorePointer"
    InputDevice "Touchpad" "SendCoreEvents"
    EndSection

    Section "InputDevice"
    Identifier "Keyboard0"
    Driver "keyboard"
    Option "CoreKeyboard"
    Option "XkbModel" "pc105"
    Option "XkbLayout" "us"
    Option "XKbOptions" ""
    EndSection

    Section "InputDevice"
    Identifier "MX1100"
    Driver "evdev"
    Option "Device" "/dev/input/mx1100"
    Option "Buttons" "10"
    Option "Emulate3Buttons" "True"
    Option "Emulate3Timeout" "50"
    Option "ZAxisMapping" "9 10"
    EndSection

    At this point, after editing and reboot, the mouse shoul be recognized and working, the evdev driver of MEPiS 8 configs fine almost all the buttons of my MX 1100, except that in KDE the Back/Forward didnt recognized by now, and the button 10 that is the hidden under thumb.

    8)For use the side thumb buttons to be recognized by all the apps inside KDE (the key detail was the correct name to make the buttons well recognized by kde as BACK and FOWARD fuction, since lots of info have mistakes or differs from what MEPiS 8 have installed), so in additon to the first post:

    First install xvkbd and xbindkeys as root or by synaptic:

    sudo apt-get install xvkbd xbindkeys

    then make settings for .xbindkeys by command

    kwrite ~/.xbindkeysrc

    and I copy my settings:

    # Mouse Buttons BACK & Foward on KDE
    "xvkbd -xsendevent -text "\[XF86Forward]""
    m:0x0 + b:8

    "xvkbd -xsendevent -text "\[XF86Back]""
    m:0x0 + b:9

    # Zoom +
    "xvkbd -xsendevent -text "\[Control]\[+]""
    m:0x0 + b:2

    # Zoom -
    "xvkbd -xsendevent -text "\[Control]\[-]]""
    m:0x0 + b:10

    and save the file.

    9) Setting xbindkeys to start at load of kDE;

    kwrite ~/.kde/Autostart/start-xbindkeys

    and copy the 2 lines below

    #!/bin/sh
    xbindkeys

    and save, then make this little script executable with command:

    chmod +x ~/.kde/Autostart/start-xbindkeys

    then, reboot and the additional mouse should work as zoom +/- and back/foward recognized on all KDE apps.

    Good luck and best regards!


    --------(code below this line, copy and paste it with name evdev-key-btn-test.c to compile the command)------------
    /*
    * evdev-key-btn-test
    *
    * Copyright (c) 2005 Brad Hards <bradh@frogmouth.net>
    * Copyright (c) 2005-2007 Andreas Schneider <mail@cynapses.org>
    *
    * This program is free software; you can redistribute it and/or modify
    * it under the terms of the GNU General Public License as published by
    * the Free Software Foundation; either version 2 of the License, or
    * (at your option) any later version.
    *
    * This program is distributed in the hope that it will be useful,
    * but WITHOUT ANY WARRANTY; without even the implied warranty of
    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    * GNU General Public License for more details.
    *
    * You should have received a copy of the GNU General Public License
    * along with this program; if not, write to the Free Software
    * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
    */
    #include <stdlib.h>
    #include <stdio.h>
    #include <sys/ioctl.h>
    #include <sys/types.h>
    #include <sys/stat.h>
    #include <asm/types.h>
    #include <fcntl.h>
    #include <unistd.h>
    #include <stdint.h>
    #include <string.h>

    #include <linux/input.h>

    /* this macro is used to tell if "bit" is set in "array"
    * it selects a byte from the array, and does a boolean AND
    * operation with a byte that only has the relevant bit set.
    * eg. to check for the 12th bit, we do (array[1] & 1<<4)
    */
    #define test_bit(bit, array) (array[bit/8] & (1<<(bit%8)))

    int main (int argc, char **argv) {

    int fd = -1;
    uint8_t key_bitmask[KEY_MAX/8 + 1];
    uint8_t rel_bitmask[REL_MAX/8 + 1];
    int yalv;
    int count = 0;

    /* ioctl() requires a file descriptor, so we check we got one, and then open it */
    if (argc != 2) {
    fprintf(stderr, "usage: %s event-device - probably /dev/input/event0\n", argv[0]);
    exit(1);
    }
    if ((fd = open(argv[1], O_RDONLY)) < 0) {
    perror("evdev open");
    exit(1);
    }

    memset(key_bitmask, 0, sizeof(key_bitmask));
    if (ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(key_bitmask)), key_bitmask) < 0) {
    perror("evdev ioctl");
    }

    memset(rel_bitmask, 0, sizeof(rel_bitmask));
    if (ioctl(fd, EVIOCGBIT(EV_REL, sizeof(rel_bitmask)), rel_bitmask) < 0) {
    perror("evdev ioctl");
    }

    printf("Supported Keys:\n");

    for (yalv = 0; yalv < KEY_MAX; yalv++) {
    if (test_bit(yalv, key_bitmask)) {
    /* this means that the bit is set in the key list */
    printf(" Key 0x%02x ", yalv);
    switch (yalv)
    {
    case KEY_RESERVED : printf(" (Reserved)\n"); count++; break;
    case KEY_ESC : printf(" (Escape)\n"); count++; break;
    case KEY_1 : printf(" (1)\n"); count++; break;
    case KEY_2 : printf(" (2)\n"); count++; break;
    case KEY_3 : printf(" (3)\n"); count++; break;
    case KEY_4 : printf(" (4)\n"); count++; break;
    case KEY_5 : printf(" (5)\n"); count++; break;
    case KEY_6 : printf(" (6)\n"); count++; break;
    case KEY_7 : printf(" (7)\n"); count++; break;
    case KEY_8 : printf(" (8)\n"); count++; break;
    case KEY_9 : printf(" (9)\n"); count++; break;
    case KEY_0 : printf(" (0)\n"); count++; break;
    case KEY_MINUS : printf(" (-)\n"); count++; break;
    case KEY_EQUAL : printf(" (=)\n"); count++; break;
    case KEY_BACKSPACE : printf(" (Backspace)\n"); count++; break;
    case KEY_TAB : printf(" (Tab)\n"); count++; break;
    case KEY_Q : printf(" (Q)\n"); count++; break;
    case KEY_W : printf(" (W)\n"); count++; break;
    case KEY_E : printf(" (E)\n"); count++; break;
    case KEY_R : printf(" (R)\n"); count++; break;
    case KEY_T : printf(" (T)\n"); count++; break;
    case KEY_Y : printf(" (Y)\n"); count++; break;
    case KEY_U : printf(" (U)\n"); count++; break;
    case KEY_I : printf(" (I)\n"); count++; break;
    case KEY_O : printf(" (O)\n"); count++; break;
    case KEY_P : printf(" (P)\n"); count++; break;
    case KEY_LEFTBRACE : printf(" ([)\n"); count++; break;
    case KEY_RIGHTBRACE : printf(" (])\n"); count++; break;
    case KEY_ENTER : printf(" (Enter)\n"); count++; break;
    case KEY_LEFTCTRL : printf(" (LH Control)\n"); count++; break;
    case KEY_A : printf(" (A)\n"); count++; break;
    case KEY_S : printf(" (S)\n"); count++; break;
    case KEY_D : printf(" (D)\n"); count++; break;
    case KEY_F : printf(" (F)\n"); count++; break;
    case KEY_G : printf(" (G)\n"); count++; break;
    case KEY_H : printf(" (H)\n"); count++; break;
    case KEY_J : printf(" (J)\n"); count++; break;
    case KEY_K : printf(" (K)\n"); count++; break;
    case KEY_L : printf(" (L)\n"); count++; break;
    case KEY_SEMICOLON : printf(" (\n"); count++; break;
    case KEY_APOSTROPHE : printf(" (')\n"); count++; break;
    case KEY_GRAVE : printf(" (`)\n"); count++; break;
    case KEY_LEFTSHIFT : printf(" (LH Shift)\n"); count++; break;
    case KEY_BACKSLASH : printf(" (\\)\n"); count++; break;
    case KEY_Z : printf(" (Z)\n"); count++; break;
    case KEY_X : printf(" (X)\n"); count++; break;
    case KEY_C : printf(" (C)\n"); count++; break;
    case KEY_V : printf(" (V)\n"); count++; break;
    case KEY_B : printf(" (B)\n"); count++; break;
    case KEY_N : printf(" (N)\n"); count++; break;
    case KEY_M : printf(" (M)\n"); count++; break;
    case KEY_COMMA : printf(" (,)\n"); count++; break;
    case KEY_DOT : printf(" (.)\n"); count++; break;
    case KEY_SLASH : printf(" (/)\n"); count++; break;
    case KEY_RIGHTSHIFT : printf(" (RH Shift)\n"); count++; break;
    case KEY_KPASTERISK : printf(" (*)\n"); count++; break;
    case KEY_LEFTALT : printf(" (LH Alt)\n"); count++; break;
    case KEY_SPACE : printf(" (Space)\n"); count++; break;
    case KEY_CAPSLOCK : printf(" (CapsLock)\n"); count++; break;
    case KEY_F1 : printf(" (F1)\n"); count++; break;
    case KEY_F2 : printf(" (F2)\n"); count++; break;
    case KEY_F3 : printf(" (F3)\n"); count++; break;
    case KEY_F4 : printf(" (F4)\n"); count++; break;
    case KEY_F5 : printf(" (F5)\n"); count++; break;
    case KEY_F6 : printf(" (F6)\n"); count++; break;
    case KEY_F7 : printf(" (F7)\n"); count++; break;
    case KEY_F8 : printf(" (F8)\n"); count++; break;
    case KEY_F9 : printf(" (F9)\n"); count++; break;
    case KEY_F10 : printf(" (F10)\n"); count++; break;
    case KEY_NUMLOCK : printf(" (NumLock)\n"); count++; break;
    case KEY_SCROLLLOCK : printf(" (ScrollLock)\n"); count++; break;
    case KEY_KP7 : printf(" (KeyPad 7)\n"); count++; break;
    case KEY_KP8 : printf(" (KeyPad 8)\n"); count++; break;
    case KEY_KP9 : printf(" (Keypad 9)\n"); count++; break;
    case KEY_KPMINUS : printf(" (KeyPad Minus)\n"); count++; break;
    case KEY_KP4 : printf(" (KeyPad 4)\n"); count++; break;
    case KEY_KP5 : printf(" (KeyPad 5)\n"); count++; break;
    case KEY_KP6 : printf(" (KeyPad 6)\n"); count++; break;
    case KEY_KPPLUS : printf(" (KeyPad Plus)\n"); count++; break;
    case KEY_KP1 : printf(" (KeyPad 1)\n"); count++; break;
    case KEY_KP2 : printf(" (KeyPad 2)\n"); count++; break;
    case KEY_KP3 : printf(" (KeyPad 3)\n"); count++; break;
    case KEY_KPDOT : printf(" (KeyPad decimal point)\n"); count++; break;
    case KEY_F13 : printf(" (F13)\n"); count++; break;
    case KEY_102ND : printf(" (Beats me...)\n"); count++; break;
    case KEY_F11 : printf(" (F11)\n"); count++; break;
    case KEY_F12 : printf(" (F12)\n"); count++; break;
    case KEY_F14 : printf(" (F14)\n"); count++; break;
    case KEY_F15 : printf(" (F15)\n"); count++; break;
    case KEY_F16 : printf(" (F16)\n"); count++; break;
    case KEY_F17 : printf(" (F17)\n"); count++; break;
    case KEY_F18 : printf(" (F18)\n"); count++; break;
    case KEY_F19 : printf(" (F19)\n"); count++; break;
    case KEY_F20 : printf(" (F20)\n"); count++; break;
    case KEY_KPENTER : printf(" (Keypad Enter)\n"); count++; break;
    case KEY_RIGHTCTRL : printf(" (RH Control)\n"); count++; break;
    case KEY_KPSLASH : printf(" (KeyPad Forward Slash)\n"); count++; break;
    case KEY_SYSRQ : printf(" (System Request)\n"); count++; break;
    case KEY_RIGHTALT : printf(" (RH Alternate)\n"); count++; break;
    case KEY_LINEFEED : printf(" (Line Feed)\n"); count++; break;
    case KEY_HOME : printf(" (Home)\n"); count++; break;
    case KEY_UP : printf(" (Up)\n"); count++; break;
    case KEY_PAGEUP : printf(" (Page Up)\n"); count++; break;
    case KEY_LEFT : printf(" (Left)\n"); count++; break;
    case KEY_RIGHT : printf(" (Right)\n"); count++; break;
    case KEY_END : printf(" (End)\n"); count++; break;
    case KEY_DOWN : printf(" (Down)\n"); count++; break;
    case KEY_PAGEDOWN : printf(" (Page Down)\n"); count++; break;
    case KEY_INSERT : printf(" (Insert)\n"); count++; break;
    case KEY_DELETE : printf(" (Delete)\n"); count++; break;
    case KEY_MACRO : printf(" (Macro)\n"); count++; break;
    case KEY_MUTE : printf(" (Mute)\n"); count++; break;
    case KEY_VOLUMEDOWN : printf(" (Volume Down)\n"); count++; break;
    case KEY_VOLUMEUP : printf(" (Volume Up)\n"); count++; break;
    case KEY_POWER : printf(" (Power)\n"); count++; break;
    case KEY_KPEQUAL : printf(" (KeyPad Equal)\n"); count++; break;
    case KEY_KPPLUSMINUS : printf(" (KeyPad +/-)\n"); count++; break;
    case KEY_PAUSE : printf(" (Pause)\n"); count++; break;
    case KEY_F21 : printf(" (F21)\n"); count++; break;
    case KEY_F22 : printf(" (F22)\n"); count++; break;
    case KEY_F23 : printf(" (F23)\n"); count++; break;
    case KEY_F24 : printf(" (F24)\n"); count++; break;
    case KEY_KPCOMMA : printf(" (KeyPad comma)\n"); count++; break;
    case KEY_LEFTMETA : printf(" (LH Meta)\n"); count++; break;
    case KEY_RIGHTMETA : printf(" (RH Meta)\n"); count++; break;
    case KEY_COMPOSE : printf(" (Compose)\n"); count++; break;
    case KEY_STOP : printf(" (Stop)\n"); count++; break;
    case KEY_AGAIN : printf(" (Again)\n"); count++; break;
    case KEY_PROPS : printf(" (Properties)\n"); count++; break;
    case KEY_UNDO : printf(" (Undo)\n"); count++; break;
    case KEY_FRONT : printf(" (Front)\n"); count++; break;
    case KEY_COPY : printf(" (Copy)\n"); count++; break;
    case KEY_OPEN : printf(" (Open)\n"); count++; break;
    case KEY_PASTE : printf(" (Paste)\n"); count++; break;
    case KEY_FIND : printf(" (Find)\n"); count++; break;
    case KEY_CUT : printf(" (Cut)\n"); count++; break;
    case KEY_HELP : printf(" (Help)\n"); count++; break;
    case KEY_MENU : printf(" (Menu)\n"); count++; break;
    case KEY_CALC : printf(" (Calculator)\n"); count++; break;
    case KEY_SETUP : printf(" (Setup)\n"); count++; break;
    case KEY_SLEEP : printf(" (Sleep)\n"); count++; break;
    case KEY_WAKEUP : printf(" (Wakeup)\n"); count++; break;
    case KEY_FILE : printf(" (File)\n"); count++; break;
    case KEY_SENDFILE : printf(" (Send File)\n"); count++; break;
    case KEY_DELETEFILE : printf(" (Delete File)\n"); count++; break;
    case KEY_XFER : printf(" (Transfer)\n"); count++; break;
    case KEY_PROG1 : printf(" (Program 1)\n"); count++; break;
    case KEY_PROG2 : printf(" (Program 2)\n"); count++; break;
    case KEY_WWW : printf(" (Web Browser)\n"); count++; break;
    case KEY_MSDOS : printf(" (DOS mode)\n"); count++; break;
    case KEY_COFFEE : printf(" (Coffee)\n"); count++; break;
    case KEY_DIRECTION : printf(" (Direction)\n"); count++; break;
    case KEY_CYCLEWINDOWS : printf(" (Window cycle)\n"); count++; break;
    case KEY_MAIL : printf(" (Mail)\n"); count++; break;
    case KEY_BOOKMARKS : printf(" (Book Marks)\n"); count++; break;
    case KEY_COMPUTER : printf(" (Computer)\n"); count++; break;
    case KEY_BACK : printf(" (Back)\n"); count++; break;
    case KEY_FORWARD : printf(" (Forward)\n"); count++; break;
    case KEY_CLOSECD : printf(" (Close CD)\n"); count++; break;
    case KEY_EJECTCD : printf(" (Eject CD)\n"); count++; break;
    case KEY_EJECTCLOSECD : printf(" (Eject / Close CD)\n"); count++; break;
    case KEY_NEXTSONG : printf(" (Next Song)\n"); count++; break;
    case KEY_PLAYPAUSE : printf(" (Play and Pause)\n"); count++; break;
    case KEY_PREVIOUSSONG : printf(" (Previous Song)\n"); count++; break;
    case KEY_STOPCD : printf(" (Stop CD)\n"); count++; break;
    case KEY_RECORD : printf(" (Record)\n"); count++; break;
    case KEY_REWIND : printf(" (Rewind)\n"); count++; break;
    case KEY_PHONE : printf(" (Phone)\n"); count++; break;
    case KEY_ISO : printf(" (ISO)\n"); count++; break;
    case KEY_CONFIG : printf(" (Config)\n"); count++; break;
    case KEY_HOMEPAGE : printf(" (Home)\n"); count++; break;
    case KEY_REFRESH : printf(" (Refresh)\n"); count++; break;
    case KEY_EXIT : printf(" (Exit)\n"); count++; break;
    case KEY_MOVE : printf(" (Move)\n"); count++; break;
    case KEY_EDIT : printf(" (Edit)\n"); count++; break;
    case KEY_SCROLLUP : printf(" (Scroll Up)\n"); count++; break;
    case KEY_SCROLLDOWN : printf(" (Scroll Down)\n"); count++; break;
    case KEY_KPLEFTPAREN : printf(" (KeyPad LH parenthesis)\n"); count++; break;
    case KEY_KPRIGHTPAREN : printf(" (KeyPad RH parenthesis)\n"); count++; break;
    case KEY_PLAYCD : printf(" (Play CD)\n"); count++; break;
    case KEY_PAUSECD : printf(" (Pause CD)\n"); count++; break;
    case KEY_PROG3 : printf(" (Program 3)\n"); count++; break;
    case KEY_PROG4 : printf(" (Program 4)\n"); count++; break;
    case KEY_SUSPEND : printf(" (Suspend)\n"); count++; break;
    case KEY_CLOSE : printf(" (Close)\n"); count++; break;
    case KEY_UNKNOWN : printf(" (Specifically unknown)\n"); count++; break;
    case KEY_BRIGHTNESSDOWN : printf(" (Brightness Down)\n"); count++; break;
    case KEY_BRIGHTNESSUP : printf(" (Brightness Up)\n"); count++; break;

    case KEY_MEDIA : printf(" (Media)\n"); count++; break;
    case KEY_OK : printf(" (Ok Key)\n"); count++; break;
    case KEY_SELECT : printf(" (Select)\n"); count++; break;
    case KEY_GOTO : printf(" (Goto)\n"); count++; break;
    case KEY_CLEAR : printf(" (Clear)\n"); count++; break;
    case KEY_POWER2 : printf(" (Power2)\n"); count++; break;
    case KEY_OPTION : printf(" (Option)\n"); count++; break;
    case KEY_INFO : printf(" (Info)\n"); count++; break;
    case KEY_TIME : printf(" (Time)\n"); count++; break;
    case KEY_VENDOR : printf(" (Vendor)\n"); count++; break;
    case KEY_ARCHIVE : printf(" (Archive)\n"); count++; break;
    case KEY_PROGRAM : printf(" (Program)\n"); count++; break;
    case KEY_CHANNEL : printf(" (Channel)\n"); count++; break;
    case KEY_FAVORITES : printf(" (Favorites)\n"); count++; break;
    case KEY_EPG : printf(" (EPG)\n"); count++; break;
    case KEY_PVR : printf(" (PVR)\n"); count++; break;
    case KEY_MHP : printf(" (MHP)\n"); count++; break;
    case KEY_LANGUAGE : printf(" (Language)\n"); count++; break;
    case KEY_TITLE : printf(" (Title)\n"); count++; break;
    case KEY_SUBTITLE : printf(" (Subtitle)\n"); count++; break;
    case KEY_ANGLE : printf(" (Angle)\n"); count++; break;
    case KEY_ZOOM : printf(" (Zoom)\n"); count++; break;
    case KEY_MODE : printf(" (Mode)\n"); count++; break;
    case KEY_KEYBOARD : printf(" (Keyboard)\n"); count++; break;
    case KEY_SCREEN : printf(" (Screen)\n"); count++; break;
    case KEY_PC : printf(" (PC)\n"); count++; break;
    case KEY_TV : printf(" (TV)\n"); count++; break;
    case KEY_TV2 : printf(" (TV2)\n"); count++; break;
    case KEY_VCR : printf(" (VCR)\n"); count++; break;
    case KEY_VCR2 : printf(" (VCR2)\n"); count++; break;
    case KEY_SAT : printf(" (SAT)\n"); count++; break;
    case KEY_SAT2 : printf(" (SAT2)\n"); count++; break;
    case KEY_CD : printf(" (CD)\n"); count++; break;
    case KEY_TAPE : printf(" (Tape)\n"); count++; break;
    case KEY_RADIO : printf(" (Radio)\n"); count++; break;
    case KEY_TUNER : printf(" (TUNER)\n"); count++; break;
    case KEY_PLAYER : printf(" (Player)\n"); count++; break;
    case KEY_TEXT : printf(" (Text)\n"); count++; break;
    case KEY_DVD : printf(" (DVD)\n"); count++; break;
    case KEY_AUX : printf(" (AUX)\n"); count++; break;
    case KEY_MP3 : printf(" (MP3)\n"); count++; break;
    case KEY_AUDIO : printf(" (Audio)\n"); count++; break;
    case KEY_VIDEO : printf(" (Video)\n"); count++; break;
    case KEY_DIRECTORY : printf(" (Directory)\n"); count++; break;
    case KEY_LIST : printf(" (List)\n"); count++; break;
    case KEY_MEMO : printf(" (Memo)\n"); count++; break;
    case KEY_CALENDAR : printf(" (Calendar)\n"); count++; break;
    case KEY_RED : printf(" (Red)\n"); count++; break;
    case KEY_GREEN : printf(" (Green)\n"); count++; break;
    case KEY_YELLOW : printf(" (Yellow)\n"); count++; break;
    case KEY_BLUE : printf(" (Blue)\n"); count++; break;
    case KEY_CHANNELUP : printf(" (Channel up)\n"); count++; break;
    case KEY_CHANNELDOWN : printf(" (Channel down)\n"); count++; break;
    case KEY_FIRST : printf(" (First)\n"); count++; break;
    case KEY_LAST : printf(" (Last)\n"); count++; break;
    case KEY_AB : printf(" (AB)\n"); count++; break;
    case KEY_NEXT : printf(" (Next)\n"); count++; break;
    case KEY_RESTART : printf(" (Restart)\n"); count++; break;
    case KEY_SLOW : printf(" (Slow)\n"); count++; break;
    case KEY_SHUFFLE : printf(" (Shuffle)\n"); count++; break;
    case KEY_BREAK : printf(" (Break)\n"); count++; break;
    case KEY_PREVIOUS : printf(" (Previous)\n"); count++; break;
    case KEY_DIGITS : printf(" (Digits)\n"); count++; break;
    case KEY_TEEN : printf(" (Teen)\n"); count++; break;
    case KEY_TWEN : printf(" (Twen)\n"); count++; break;
    case KEY_MAX : printf(" (MAX)\n"); count++; break;

    case BTN_0 : printf(" (Button 0)\n"); count++; break;
    case BTN_1 : printf(" (Button 1)\n"); count++; break;
    case BTN_2 : printf(" (Button 2)\n"); count++; break;
    case BTN_3 : printf(" (Button 3)\n"); count++; break;
    case BTN_4 : printf(" (Button 4)\n"); count++; break;
    case BTN_5 : printf(" (Button 5)\n"); count++; break;
    case BTN_6 : printf(" (Button 6)\n"); count++; break;
    case BTN_7 : printf(" (Button 7)\n"); count++; break;
    case BTN_8 : printf(" (Button 8)\n"); count++; break;
    case BTN_9 : printf(" (Button 9)\n"); count++; break;
    case BTN_LEFT : printf(" (Left Button)\n"); count++; break;
    case BTN_RIGHT : printf(" (Right Button)\n"); count++; break;
    case BTN_MIDDLE : printf(" (Middle Button)\n"); count++; break;
    case BTN_SIDE : printf(" (Side Button)\n"); count++; break;
    case BTN_EXTRA : printf(" (Extra Button)\n"); count++; break;
    case BTN_TASK : printf(" (Task Button)\n"); count++; break;
    case BTN_FORWARD : printf(" (Forward Button)\n"); count++; break;
    case BTN_BACK : printf(" (Back Button)\n"); count++; break;
    case BTN_TRIGGER : printf(" (Trigger Button)\n"); count++; break;
    case BTN_THUMB : printf(" (Thumb Button)\n"); count++; break;
    case BTN_THUMB2 : printf(" (Second Thumb Button)\n"); count++; break;
    case BTN_TOP : printf(" (Top Button)\n"); count++; break;
    case BTN_TOP2 : printf(" (Second Top Button)\n"); count++; break;
    case BTN_PINKIE : printf(" (Pinkie Button)\n"); count++; break;
    case BTN_BASE : printf(" (Base Button)\n"); count++; break;
    case BTN_BASE2 : printf(" (Second Base Button)\n"); count++; break;
    case BTN_BASE3 : printf(" (Third Base Button)\n"); count++; break;
    case BTN_BASE4 : printf(" (Fourth Base Button)\n"); count++; break;
    case BTN_BASE5 : printf(" (Fifth Base Button)\n"); count++; break;
    case BTN_BASE6 : printf(" (Sixth Base Button)\n"); count++; break;
    case BTN_DEAD : printf(" (Dead Button)\n"); count++; break;
    case BTN_A : printf(" (Button A)\n"); count++; break;
    case BTN_B : printf(" (Button B)\n"); count++; break;
    case BTN_C : printf(" (Button C)\n"); count++; break;
    case BTN_X : printf(" (Button X)\n"); count++; break;
    case BTN_Y : printf(" (Button Y)\n"); count++; break;
    case BTN_Z : printf(" (Button Z)\n"); count++; break;
    case BTN_TL : printf(" (Thumb Left Button)\n"); count++; break;
    case BTN_TR : printf(" (Thumb Right Button )\n"); count++; break;
    case BTN_TL2 : printf(" (Second Thumb Left Button)\n"); count++; break;
    case BTN_TR2 : printf(" (Second Thumb Right Button )\n"); count++; break;
    case BTN_SELECT : printf(" (Select Button)\n"); count++; break;
    case BTN_MODE : printf(" (Mode Button)\n"); count++; break;
    case BTN_THUMBL : printf(" (Another Left Thumb Button )\n"); count++; break;
    case BTN_THUMBR : printf(" (Another Right Thumb Button )\n"); count++; break;
    case BTN_TOOL_PEN : printf(" (Digitiser Pen Tool)\n"); count++; break;
    case BTN_TOOL_RUBBER : printf(" (Digitiser Rubber Tool)\n"); count++; break;
    case BTN_TOOL_BRUSH : printf(" (Digitiser Brush Tool)\n"); count++; break;
    case BTN_TOOL_PENCIL : printf(" (Digitiser Pencil Tool)\n"); count++; break;
    case BTN_TOOL_AIRBRUSH : printf(" (Digitiser Airbrush Tool)\n"); count++; break;
    case BTN_TOOL_FINGER : printf(" (Digitiser Finger Tool)\n"); count++; break;
    case BTN_TOOL_MOUSE : printf(" (Digitiser Mouse Tool)\n"); count++; break;
    case BTN_TOOL_LENS : printf(" (Digitiser Lens Tool)\n"); count++; break;
    case BTN_TOUCH : printf(" (Digitiser Touch Button )\n"); count++; break;
    case BTN_STYLUS : printf(" (Digitiser Stylus Button )\n"); count++; break;
    case BTN_STYLUS2 : printf(" (Second Digitiser Stylus Button )\n"); count++; break;
    case BTN_TOOL_DOUBLETAP : printf(" (Digitiser Doubletap Tool)\n"); count++; break;
    case BTN_TOOL_TRIPLETAP : printf(" (Digitiser Tripletap Tool)\n"); count++; break;
    case BTN_GEAR_DOWN : printf(" (Wheel Up\n"); count++; break;
    case BTN_GEAR_UP : printf(" (Wheel Down\n"); count++; break;
    default:
    printf(" (Unknown key)\n"); count++;
    } /* switch */
    } /* if */
    } /* for */

    printf("Buttons/Keys: %3d\n\n", count);

    printf("Supported Relative axes:\n");

    for (yalv = 0; yalv < REL_MAX; yalv++) {
    if (test_bit(yalv, rel_bitmask)) {
    /* this means that the bit is set in the axes list */
    printf(" Relative axis 0x%02x ", yalv);
    switch ( yalv)
    {
    case REL_X :
    printf(" (X Axis)\n");
    break;
    case REL_Y :
    printf(" (Y Axis)\n");
    break;
    case REL_Z :
    printf(" (Z Axis)\n");
    break;
    case REL_HWHEEL :
    printf(" (Horizontal Wheel)\n");
    break;
    case REL_DIAL :
    printf(" (Dial)\n");
    break;
    case REL_WHEEL :
    printf(" (Vertical Wheel)\n");
    break;
    case REL_MISC :
    printf(" (Miscellaneous)\n");
    break;
    default:
    printf(" (Unknown relative feature)\n");
    }
    }
    }

    close(fd);

    exit(0);
    }



Working...
X