 |
 |
 |
 |
| Hardware & Laptops Help with your hardware, including laptop issues |

6th August 2009, 06:17 AM
|
|
Registered User
|
|
Join Date: Jul 2009
Posts: 21

|
|
|
Fixing dim/brighten screen buttons (creating keyboard shortcut + mapping to keys)
I'm on a sony vaio tz150n, using (up-to-date) F11 and KDE 4.3. My laptop has function keys that alter the brightness, but the keys don't do anything. Is there an (easy?) way to get the brightness-adjust keys to function similarly to the volume-adjust keys?
I figure there are two steps: First, finding the command to lower/raise the brightness level; and finding a way to map the key (because when I try to use the brightness-adjust fn key I get the message that the key is not supported in KDE.)
I'm lost and in need of assistance.
|

6th August 2009, 07:20 AM
|
|
Registered User
|
|
Join Date: Feb 2009
Posts: 2,535

|
|
You first need to know the key codes for your hot keys. One way to obtain the key codes is to use xev in a terminal window. Then you press the particular key you want to configure and the output should look something like this :
Code:
KeyRelease event, serial 26, synthetic NO, window 0x4000001,
root 0xaf, subw 0x0, time 3472341, (-84,687), root:(726,716),
state 0x10, keycode 26 (keysym 0x65, e), same_screen YES,
XLookupString gives 1 bytes: "e"
The example is for the key "e" and the keycode for "e" is "26". Then you need to map that keycode to the desired function. I don't have KDE, so I don't know if theres a GUI-way of doing that. In general, you can edit Xmodmap file and put in something like this:
Code:
keycode 174 = XF86AudioLowerVolume
keycode 176 = XF86AudioRaiseVolume
keycode 160 = XF86AudioMute
Where 174, for instance, would be the keycode obtained through xev and XF86AudioLowerVolume is the funktion you want to map it to. The Xmodmap file is usually stored in your /home directory under the name ".Xmodmap".
Hope that helps.
|

6th August 2009, 06:39 PM
|
|
Registered User
|
|
Join Date: Jul 2009
Posts: 21

|
|
Sweet. I found the Xmodmap in "/etc/X11" and it turns out the keys are 232 and 233 for dim and brighten (respectively.) Seeing as this is the global map, I'm quite scared to mess with it -- but as the saying goes, "nothing ventured, nothing gained."
I did a bit of googling on xmodmap and found that "/sur/share/X11/XKeysymDB" has a nice listing of standard key names, so using that I added the following lines to my global Xmodmap:
Code:
! Vaio Keyboard support
keycode 232 = XF86MonBrightnessDown
keycode 233 = XF86MonBrightnessUp
Gonna restart now and see if it works
 Unfortunately, I still keep getting the 'key isn't supported in qt' message whenever I try to map it to any arbitrary command. Next is to name it something else. Also, to get dim and brighten working.
Last edited by sexyclient; 6th August 2009 at 08:02 PM.
|

7th August 2009, 09:54 AM
|
|
Registered User
|
|
Join Date: Feb 2009
Posts: 2,535

|
|
|
If you are afraid of messing up the global mapping, then create a local file in your /home directory. The local file should be named ".Xmodmap". If you don't like it, you can easily delete it.
|

8th August 2009, 12:12 AM
|
|
Registered User
|
|
Join Date: Jul 2009
Posts: 21

|
|
|
Thanks, though, but I took the plunge and am still getting the "key is not supported in qt" error. I'll create an .Xmodmap file locally and see if it works. Maybe I'll map the keys to F18 and F19, lol.
The more pressing issue, however, is finding a command to execute for dimming the screen. Google hasn't helped me out one bit in this regard, and I'm starting to doubt whether it's even possible to do so in linux.
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Current GMT-time: 18:59 (Monday, 20-05-2013)
|
|
 |
 |
 |
 |
|
|