You are not logged in.

#1 2010-01-09 02:56:51

onguarde
Member
Registered: 2008-09-14
Posts: 144

Map Thinkpad Mouse Buttons to Keyboard Key

Peace all!

Does anyone know of a way to map the thinkpad mouse buttons to a normal keyboard key? I am unable to identify any mappable keycode using xev. Is it hardwired or something?

ButtonPress event, serial 34, synthetic NO, window 0x4600001,
    root 0x115, subw 0x0, time 3353217, (155,11), root:(901,337),
    state 0x0, button 1, same_screen YES

ButtonRelease event, serial 34, synthetic NO, window 0x4600001,
    root 0x115, subw 0x0, time 3353326, (155,11), root:(901,337),
    state 0x100, button 1, same_screen YES

What I've managed to do is the opposite; map a keyboard key to a mouse button.

http://www.geocities.jp/fred_b_maciel/kbd/kbd-e.html

Basically involves using the Accessibility X mouse controlling feature(usually using numpad keys); remapping those to other keys.

Thanks in advance?

Offline

#2 2010-01-09 03:50:41

Gen2ly
Member
From: Sevierville, TN
Registered: 2009-03-06
Posts: 1,529
Website

Re: Map Thinkpad Mouse Buttons to Keyboard Key

On my iBook I previously mapped mouse buttons to the keyboard through the mac-hid kernel option:

echo 1 > /proc/sys/dev/mac_hid/mouse_button_emulation
echo 67 > /proc/sys/dev/mac_hid/mouse_button2_keycode #for F9
echo 68 > /proc/sys/dev/mac_hid/mouse_button3_keycode #for F10

There might be something like this for regular keyboards, though from what I remember people commonly use a different method (probably xbindkeys).  Really learned that this wasn't a good way to go after a while though as there is likely not a key on you keyboard that not be used by some program.  On the iBook there is the Apple key that didn't - I don't think this is likely though on your Thinkpad. big_smile

Last edited by Gen2ly (2010-01-09 03:53:47)


Setting Up a Scripting Environment | Proud donor to wikipedia - link

Offline

#3 2010-01-09 05:41:22

onguarde
Member
Registered: 2008-09-14
Posts: 144

Re: Map Thinkpad Mouse Buttons to Keyboard Key

http://wiki.archlinux.org/index.php/Map … o_keycodes
I presume I have to use this?

http://wiki.archlinux.org/index.php/Setkeycodes
The only way to detect a scancode is with,

dmesg|tail -10

fact, any time we press a key which has a scancode but no keycode, the kernel suggests us to use just 'setkeycodes' to

The problem is thinkpad's mouse buttons are already bound. Is there another way to find out?

The "Using HAL" website is broken.

Also, is there a way to determine if the keys are actually hardware bound? Some of the thinkpad's keys are eg. FN keys and maybe the mute/light keys. In that case, there's no point in continuing further.

Offline

Board footer

Powered by FluxBB