View previous topic :: View next topic |
Author |
Message |
TrentonAdams n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 16 Aug 2008 Posts: 64
|
Posted: Mon Mar 09, 2009 1:52 am Post subject: reversing media keys (e.g. volume, lcd brightness, etc) |
|
|
Hi Guys,
I have a Macbook, and I'd like the volume keys (F3-F5), and all the other FX keys to behave like FX keys, unless I press "fn" first.
Is there an easy way of reversing the behaviour of my media keys so that I get the behaviour described?
Thanks in advance. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Malvineous Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/18723455534882c8282ef47.png)
Joined: 20 Oct 2006 Posts: 281 Location: Brisbane, Australia
|
Posted: Mon Mar 09, 2009 10:26 pm Post subject: |
|
|
It depends how the keyboard is set up. Usually Fn+key generates a unique scancode, so the OS never sees the Fn keypress. If that's the case, then you can't control how the Fn key behaves. You can however manually switch scancodes, so a volume key produces an F3 keycode, and the F3 key produces a volume keycode, which might do what you're after.
Look into xev (for printing keycodes) and xmodmap. For example, I have this in ~/.Xmodmap to set my extra function keys (G1-G6) to F21-F26:
Code: | keycode 177 = F21
keycode 152 = F22
keycode 190 = F23
keycode 208 = F24
keycode 129 = F25
|
Of course this will only work if the OS is doing all the processing - if the volume keys are being handled by the BIOS, then it won't work (and you won't see anything when you press the key in the xev window.) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
TrentonAdams n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 16 Aug 2008 Posts: 64
|
Posted: Mon Mar 09, 2009 10:37 pm Post subject: |
|
|
Hi Malvineous,
I've already done some remappings. But, what I'm finding is that when I do that, the mappings work, but the system still acts as if those keys were pressed. e.g. I'm getting my brightness turned down, and it's acting as F1 as well. Perhaps I didn't do enough remapping. Here is what I was doing...
For example...
keycode 101 is (fn+F1)
keycode 67 is (F1 by itself)
The xmod remapping below works, except it still does it's special function, such as adjusting my brightness. It was not this way with some previous kernels. For example, 2.6.17 did not have support for those keys at all, at least not by default. So, I'm wondering if there's anything that can be done on startup, to avoid X key bindings completely. Then X can pick it up from the console as it normally does.
Code: | remove Lock = F1
remove Control = F1
keycode 101 = F1
add Control = F1
keycode 67 = NoSymbol
|
Thanks. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Malvineous Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/18723455534882c8282ef47.png)
Joined: 20 Oct 2006 Posts: 281 Location: Brisbane, Australia
|
Posted: Tue Mar 10, 2009 9:58 am Post subject: |
|
|
Do the keys still function without X11 loaded? Perhaps the kernel is handling the keys before passing them to X11? You might need to use one of the console commands (loadkeys? setkeys?) to stop the kernel from using the key. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
TrentonAdams n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 16 Aug 2008 Posts: 64
|
Posted: Tue Mar 10, 2009 4:51 pm Post subject: |
|
|
Malvineous wrote: | Do the keys still function without X11 loaded? Perhaps the kernel is handling the keys before passing them to X11? You might need to use one of the console commands (loadkeys? setkeys?) to stop the kernel from using the key. |
Yes, I believe it is the kernel because they do not function as FX keys in the console either. I'll look into those apps.
Thanks. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|