Fedora Linux Support Community & Resources Center
  #1  
Old 6th August 2009, 06:17 AM
sexyclient Offline
Registered User
 
Join Date: Jul 2009
Posts: 21
linuxfedorafirefox
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.
Reply With Quote
  #2  
Old 6th August 2009, 07:20 AM
CSchwangler Offline
Registered User
 
Join Date: Feb 2009
Posts: 2,535
windows_xp_2003firefox
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.
Reply With Quote
  #3  
Old 6th August 2009, 06:39 PM
sexyclient Offline
Registered User
 
Join Date: Jul 2009
Posts: 21
linuxfedorafirefox
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.
Reply With Quote
  #4  
Old 7th August 2009, 09:54 AM
CSchwangler Offline
Registered User
 
Join Date: Feb 2009
Posts: 2,535
windows_xp_2003firefox
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.
Reply With Quote
  #5  
Old 8th August 2009, 12:12 AM
sexyclient Offline
Registered User
 
Join Date: Jul 2009
Posts: 21
linuxfedorafirefox
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.
Reply With Quote
Reply

Tags
buttons, creating, dim or brighten, fixing, keyboard, keys, mapping, screen, shortcut

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
shortcut keys slimg00dy Using Fedora 0 1st October 2009 11:24 PM
Help setting up a keyboard shortcut to lock the screen? RichGags Using Fedora 3 3rd February 2006 12:53 PM
help mapping shortcut keys on mouse and keyboard agentblue Hardware & Laptops 8 23rd June 2005 09:42 AM
Anyone use the extra shortcut buttons on your keyboard? Kocch Hardware & Laptops 2 5th January 2005 10:30 PM


Current GMT-time: 18:59 (Monday, 20-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat