X4Daemon is created to make it possible to use the extra keys on Microsoft’s Sidewinder X4 keyboard, which weren’t usable under linux until now. It takes control over the second interface of your X4 keyboard (first interface controls the “standard” keys, second interface controls the “special” keys like all media keys, calculator, S1 to S6,etc.) and passes all presses to uinput.
Under Windows you can record macros and switch between 3 banks on your X4 keyboard. I didn’t implement this feature because it is entirely done in software and my primary objective was to get the special keys working. I am also working on something for the 5 LEDs, it should be possible to use them for notifications or something like that. This will be released in some future version of X4Daemon.
Depending on your windowmanager you should be able to define keys somewhere, I use S1-S6 and Bank_Switch for switching between my virtual desktops in AwesomeWM, which is very nice. I didn’t test this in Gnome or KDE, but it should work fine. You can check if X4Daemon works correctly with xev. Mail me if you have problems getting it to work!.
I have no X6 keyboard, so if you have a X6 keyboard try it! You need to change the ProductID to the correct one (get it with lsusb) and then compile it. I don’t know if X6 has more keys or uses other keycodes, but if you mail me correct X6 keycodes I think I can implement them. But I don’t know how to get those keycodes, I didn’t need to find them for X4 because someone else did it already (see “Special thanks..”).
I made this package for Archlinux, I didn’t test it on any other distros. It should work fine, but you have to write your own init script I think. (I only wrote one for Archlinux.). If you got a working init script for your distro, mail it to me.
Howto compile it on other distros than Archlinux:
- I assume that you have build-essential (gcc,make,..), checkinstall, autoconf>=2.68 and libusb-1.0.0-dev installed. (package names depend on used distro)
- Download the sources
- tar -xvjf <archivename>
- autoconf (maybe not needed, only try if you have autoconf >= 2.68)
- sudo checkinstall (or sudo make install <- not recommended)
- Start x4daemon (sudo x4daemon -w)
- For automatic start, just put x4daemon -w -D to /etc/rc.local (or create a init script for you distro ;))
2011/12/30 Version 0.1
– initial release
2011/12/31 Version 0.2
– added daemon mode (-D)
– added reinitalization when disconnecting device
– added waiting mode if disconnecting device (-w)
– added syslog for daemon mode
– added init script for arch linux
– added waiting for device at start when using -w
2012/01/07 Version 0.3
– added better checks to configure.ac
– added check for uniput module
– added auto load function for uinput module
– fixed some warnings while compiling (for some other distros)
2012/01/10 Version 0.4
– fixed help buffer error for -h
– added some more help/readme stuff (mainly XF86Keycodes)
– fixed pipes for some older shells (&> does not work on some sh)
– added waiting code after loading uinput module (for some distris like debian)
2012/01/14 Version 0.4.1
– changed version scheme
– fixed a bug for siduction, NULL for standard context in libusb_get_device_list does not work there
2012/01/14 Version 0.4.2
– fixed new version scheme problems…
2012/09/05 Version 0.4.3
– added systemd unit file
2012/09/05 Version 0.4.4
– fixed systemd unit file
– It works fine on virtualbox (stop X4Daemon on the host before trying!) until you want to end X4Daemon. X4Daemon then can’t release the interface correctly until you disconnect the usb device in virtualbox’s menu (X4Daemon will hang until you do this). This is not caused by X4Daemon (I think), it seem to be some problem with virtualbox’s usb drivers.
X4Daemon is reported/tested as working on following Distributions:
– Archlinux (of course)
– Linux Mint 11
– Debian Squeeze
Usage: x4daemon [OPTION]…
|-d,–debug||Activate debug mode.|
|-D, –daemon||Activate daemon mode, alle messages go to syslog.|
|-h, –help||Show this help page.|
|-r, –reset||Reset device when starting (shouldn’t be necessary).|
|-v, –version||Show version.|
|-w, –waiting||Wait for device at start and if it disconnects.|
Standard assignment of keys is:
|Key:||Keycode (input.h):||Keycode:||Keycode (XF86):|
You can change the keys in source code, see keys array.
(I just used some unused keycodes for the special keys.)
Mute,Prev,Next,PlayPause,VolDown, VolUP and Calc use the same keycodes as before.
See /usr/include/linux/input.h for more information.
It is not possible to switch banks or to record macros.
If you find any bugs or if you want to tell me something click here.
X4Daemon comes with absolutely no warranty.
It is licensed under the GPL (General Public License), version 2 or later.
Details should be in the src package or at http://www.gnu.org/licenses/licenses.
Older versions of X4Daemon: