bedis9
a little bit of anything
Fix broken left click on Linux
At home, I run a debian Squeeze on my 2008 macbook.
Lately, I had an issue: when my computer woke up after a sleep period, the left click of my mouse did not work anymore.
I had to restart my X server to recover the left click.
Actually, there is some conflict between my macbook native mouse and my USB mouse.
Fortunately, in Debian (and in other distros too), there is a tool called xinput which is used to configure X window input devices.
First, list the devices available for my macbook:
$ xinput --list ⎡ Virtual core pointer id=2 [master pointer (3)] ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)] ⎜ ↳ Microsoft Microsoft Notebook/Mobile Optical Mouse 2.0 id=10 [slave pointer (2)] ⎜ ↳ appletouch id=12 [slave pointer (2)] ⎜ ↳ Macintosh mouse button emulation id=14 [slave pointer (2)] ⎣ Virtual core keyboard id=3 [master keyboard (2)] ↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)] ↳ Power Button id=6 [slave keyboard (3)] ↳ Video Bus id=7 [slave keyboard (3)] ↳ Power Button id=8 [slave keyboard (3)] ↳ Sleep Button id=9 [slave keyboard (3)] ↳ Apple Computer Apple Internal Keyboard / Trackpad id=11 [slave keyboard (3)] ↳ Apple Computer Apple Internal Keyboard / Trackpad id=13 [slave keyboard (3)]
As you can see, I have 2 mouses on my macbook:
- the native one: appletouch id=12
- the USB one:Microsoft Microsoft Notebook/Mobile Optical Mouse 2.0 id=10
To avoid any conflict between both mouses, I simply disable the native mouse, since I don’t use it.
Simply run:
$ xinput --set-prop 12 "Device Enabled" 0
Which means that I disabled the mouse with the id 12.
Don’t forget to update your xinitrc or your autostart.sh, if you’re using openbox like me.