Home » Projects » Mouse hack for Nokia N800/N810

Preliminary mouse hack for Nokia Nseries

This is a simple hack, instead of hacking the hacked kdrive X server from Nokia, I've written a simple mouse polling program. It doesn't fully work, Mouse clicks doesn't seem to be well handled. Clicks on the application menu doesn't pop-up anythings, neither in minimo (I suspect the pressure detection code which is overriding the ButtonPress/Release events, or maybe something with tslib.

If you want to help, contact me at maemo@devlife.org

In order to compile it, just type:

gcc mouse_poll.c -o mouse_poll -lX11

Download icons from here: http://www.xaprb.com/ and put them in /home/user/.icons. Edit /home/user/.Xdefaults and put this:

Xcursor.theme: icon_folder_name

Evdev input device can be found in /proc/bus/input/devices, here's mine:

I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="Internal keyboard"
P: Phys=0-0045/input-kp
S: Sysfs=/class/input/input0
H: Handlers=kbd event0 
B: EV=3
B: KEY=10000 0 0 0 0 0 0 0 0 0 0 80001683 7 c21ff5ff d3ff7002

I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="retu-pwrbutton"
P: Phys=
S: Sysfs=/class/input/input1
H: Handlers=kbd event1 
B: EV=3
B: KEY=100000 0 0 0

I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="retu-headset"
P: Phys=
S: Sysfs=/class/input/input2
H: Handlers=kbd event2 
B: EV=3
B: KEY=200 0 0 0 0 0

I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="TSC2301 touchscreen"
P: Phys=spi1.0/input-ts
S: Sysfs=/class/input/input3
H: Handlers=event3 
B: EV=b
B: KEY=0
B: ABS=1000003

I: Bus=0003 Vendor=046d Product=c001 Version=0110
N: Name="Logitech USB Mouse"
P: Phys=usb-musb_hdrc-1/input0
S: Sysfs=/class/input/input4
H: Handlers=mouse0 event4
B: EV=7
B: KEY=70000 0 0 0 0 0 0 0 0
B: REL=103

You can see the Logitech mouse, and its event handler. Just launch the mouse polling program like that:

# mouse_poll /dev/input/event4

Last updated on 2008-08-26