LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-09-2010, 03:00 PM   #1
denisq
LQ Newbie
 
Registered: Nov 2004
Posts: 17

Rep: Reputation: 0
Unlink action from keycode


Hello,

I am trying to unlink the action triggered by my fn-F5 key, which is a toggle wlan action. I really don't know were this kind of action is defined, but I want to replace it by another one. It should happen either by unlinking that action or by overriding.

The key is catched by HAL:
showkey gives: Keycode 238
the driver defines: {KE_KEY, 0x0E, KEY_WLAN }, 0x0E being the scancode
and HAL knows it as: 'wlan'

Thank you in advance for your help and tips, I highly appreciate!

Best regards,
Quentin
 
Old 06-09-2010, 10:52 PM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
This LQ post may help.
 
0 members found this post helpful.
Old 06-10-2010, 06:01 PM   #3
denisq
LQ Newbie
 
Registered: Nov 2004
Posts: 17

Original Poster
Rep: Reputation: 0
Well, this does not help since it is about acpi events and I am using HAL events. Since the keycode is hardcoded in the driver, I probably won't be able to unlink it. One solution that comes across would be to override the keycode with a fdi file for HAL. Now, the question is how to find out the appropriate scancode, for example [1]:

<match key="system.hardware.vendor" prefix="LENOVO">
<match key="system.hardware.version" contains="3000">
<append key="input.keymap.data" type="strlist">e016:wifi</append> <!-- Fn+F5 Wireless -->
<append key="info.capabilities" type="strlist">input.keymap</append>
</match>
</match>

So, how do I find out the equivalent of e016:wifi on my box? The only information I have is:
showkey gives: Keycode 238
the driver[2] defines: {KE_KEY, 0x0E, KEY_WLAN }, 0x0E being the hex scancod

Are 0x0E and e016 both hex values, equivalent format? So can I use 0x0e:wifi?

Thanks for your support and kind regards,
Quentin

[1] http://hal.freedesktop.org/quirk/quirk-keymap-try.html
[2] http://github.com/tetromino/lenovo-s...vo-sl-laptop.c
 
Old 06-17-2010, 10:58 AM   #4
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Any progress? I made some Fn+ keys do as wanted in the Desktop by mapping them to "Application Shortcuts" bu that is, of course, only effective after graphical login -- would be nice to do it at a lower level so they are effective in more states, including when displaying virtual terminals.
 
Old 07-04-2010, 03:39 PM   #5
denisq
LQ Newbie
 
Registered: Nov 2004
Posts: 17

Original Poster
Rep: Reputation: 0
Thumbs up

Quote:
Originally Posted by catkin View Post
Any progress? I made some Fn+ keys do as wanted in the Desktop by mapping them to "Application Shortcuts" bu that is, of course, only effective after graphical login -- would be nice to do it at a lower level so they are effective in more states, including when displaying virtual terminals.
Ok, I made some progress: forget HAL, it is deprecated[1] and now udev takes over the keymaps. It works much better and is newer. You should read the following file to get familiar with it: /usr/share/doc/packages/udev/README.keymap.txt (on openSUSE, similar path on other distros)

The problem I now encounter is that I have two input devices on my laptop: /dev/input/event0 for my standard keyboard (AT) and /dev/input/event11 for the Lenovo ThinkPad specialkeys. Writing the config worked only for the first one, for now. If you can figure out how to edit the config for the second device, let me know!

The manual command to map the keys is the following:
Code:
/lib/udev/keymap /dev/input/event11 0x0E bluetooth
With that I can override the keycode 'wlan' given by the driver with 'bluetooth' (you could map it to 'prog1' or similar to use it with the KDE shortcuts).

It works really fine, just have to figure out how to make this permanent.

Regards.

PS: you can find the scancodes with 'showkey -s' as root, but I looked it up in the driver sources [2]

[1] https://wiki.ubuntu.com/Hotkeys/Architecture
[2] http://github.com/tetromino/lenovo-s...vo-sl-laptop.c

Last edited by denisq; 07-04-2010 at 03:42 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
RM: Cannot Unlink margolik Linux - Software 0 04-17-2004 11:03 AM
perl unlink? sk8guitar Programming 11 08-13-2003 10:44 AM
cannot unlink messages TruckStuff Linux - General 5 02-13-2003 02:04 PM
cannot unlink simon Linux - General 1 07-31-2001 07:25 PM
How to unlink a directory? _TK_ Linux - General 4 04-25-2001 08:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration