LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-19-2010, 09:23 PM   #1
alquery
LQ Newbie
 
Registered: Jul 2010
Posts: 7

Rep: Reputation: 0
Bind certain keys to change screen brightness


Hi - I am using Ubuntu linux, and I want fn + up key and fn + down key to change the brightness instead on fn + F4 and fn + F5. I've tried looking for something in the Keyboard Shortcuts menu, but there is no command or key specified to do that. I could make a custom key shortcut, but I can't find the command to change the brightness. Is there a way to make another key do this?
My laptop is a Dell Inspiron 1545.
 
Old 07-20-2010, 10:46 PM   #2
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 250Reputation: 250Reputation: 250
Is there a file relating to your laptop in /usr/share/hotkey-setup/ ?

If so, you may be able to edit that to use the keys you want.

This is the example for a samsung laptop.
 
Old 07-29-2010, 06:48 PM   #3
alquery
LQ Newbie
 
Registered: Jul 2010
Posts: 7

Original Poster
Rep: Reputation: 0
No, there's not... Any other ideas?
 
Old 08-19-2010, 09:17 AM   #4
alquery
LQ Newbie
 
Registered: Jul 2010
Posts: 7

Original Poster
Rep: Reputation: 0
bump
 
Old 08-22-2010, 04:07 PM   #5
alquery
LQ Newbie
 
Registered: Jul 2010
Posts: 7

Original Poster
Rep: Reputation: 0
bump

bump
 
Old 08-23-2010, 09:51 AM   #6
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
Have you tried running the setkeycode commands illustrated in the linked page? There are similar commands on this Arch Linux Wiki page for a Samsung N150.

On a Samsung N150 running Slackware 13.1 Linux and Xfce desktop, I enabled brightness adjustment via Fn+Up and Fn+Dn by running the following commands from the boot scripts
Code:
setkeycodes e008 225   # Fn+Up maps to brightnessup
setkeycodes e009 224   # Fn+Dn maps to brightnessdown
These are made effective in the GUI by mapping XF86MonBrightnessDown (and Up) to call a custom script.
 
Old 08-23-2010, 08:01 PM   #7
alquery
LQ Newbie
 
Registered: Jul 2010
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by catkin View Post
Have you tried running the setkeycode commands illustrated in the linked page? There are similar commands on this Arch Linux Wiki page for a Samsung N150.

On a Samsung N150 running Slackware 13.1 Linux and Xfce desktop, I enabled brightness adjustment via Fn+Up and Fn+Dn by running the following commands from the boot scripts
Code:
setkeycodes e008 225   # Fn+Up maps to brightnessup
setkeycodes e009 224   # Fn+Dn maps to brightnessdown
These are made effective in the GUI by mapping XF86MonBrightnessDown (and Up) to call a custom script.
When I try those commands, I get this:

Code:
Couldn't get a file descriptor referring to the console
I'm very confused here, and what's all this about Samsung N150? Do these keycodes still apply to me if I'm not using that? Also, I have no /usr/share/hotkey-setup directory. Why don't I have one?

Last edited by alquery; 08-23-2010 at 08:02 PM. Reason: Got rid of obvious question
 
Old 08-23-2010, 09:08 PM   #8
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
Quote:
Originally Posted by alquery View Post
When I try those commands, I get this:

Code:
Couldn't get a file descriptor referring to the console
I'm very confused here, and what's all this about Samsung N150? Do these keycodes still apply to me if I'm not using that? Also, I have no /usr/share/hotkey-setup directory. Why don't I have one?
Were you root or an ordinary user?

Ideally you want someone answering who has got those keys working on the same laptop as yours, using the same distro but they haven't come along yet. Laptops/netbooks differ, distros differ (there's no /usr/share/hotkey-setup on my Slackware 13.1 system either) but some things work the same way (the distros are all Linux-based, manufacturers use the same chips) so it's worth trying things that have worked on dissimilar systems.
 
Old 08-24-2010, 02:26 PM   #9
alquery
LQ Newbie
 
Registered: Jul 2010
Posts: 7

Original Poster
Rep: Reputation: 0
Okay, so I entered the commands as root and it didn't give me any errors. However, the arrow keys still don't work for changing brightness. I've tried finding out the keycodes with xev, but it returns the same code whether I'm holding down fn or not. I also tried mapping it using System > Preferences > Keyboard Shortcuts, but it wouldn't recognize fn + up as any different from just up either. It seems like the keyboard only recognizes key combinations with functions that came with the computer, not fn as a separate key, like I thought. Is there any way to change this, or is it set in stone?
 
Old 08-24-2010, 05:56 PM   #10
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
It may be that the keycodes generated by Fn+Up/Dn on a Dell Inspiron 1545 are not the same as on a Samsung N10 or N150. Unfortunately IDK how you can find out what they are. xev output for Fn+Up/Dn on my system doesn't make much sense either.

It would make sense for the keyboard not to output anything unless the Fn modifier is used with a key "that came with the computer", usually marked in blue (all the arrow keys are marked in blue on the N150).

The Fn is a modifier key, as are like alt, ctrl, shift and super. I thought modifier keys alone did not generate keycodes but recently found that is wrong having been able to interactively set super alone (and super+e) as shortcut keys under Xfce.

There is thus some hope for being able to do what you want but I don't know the crucial next step of how to find out the keycodes generated by experimental key and key combination use. You could start a new topic asking that question.
 
Old 08-24-2010, 06:38 PM   #11
alquery
LQ Newbie
 
Registered: Jul 2010
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by catkin View Post
It may be that the keycodes generated by Fn+Up/Dn on a Dell Inspiron 1545 are not the same as on a Samsung N10 or N150. Unfortunately IDK how you can find out what they are. xev output for Fn+Up/Dn on my system doesn't make much sense either.

It would make sense for the keyboard not to output anything unless the Fn modifier is used with a key "that came with the computer", usually marked in blue (all the arrow keys are marked in blue on the N150).

The Fn is a modifier key, as are like alt, ctrl, shift and super. I thought modifier keys alone did not generate keycodes but recently found that is wrong having been able to interactively set super alone (and super+e) as shortcut keys under Xfce.

There is thus some hope for being able to do what you want but I don't know the crucial next step of how to find out the keycodes generated by experimental key and key combination use. You could start a new topic asking that question.
This is getting a bit out of hand here, just to change a few keys

I'll just use the GUI to set the Control key instead, so ctrl + up and down to xbacklight -inc 10 and xbacklight -dec 10, respectively.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
ctrl+up|down don't change screen brightness any more zoran119 Slackware 1 07-17-2010 01:44 PM
Brightness of screen does not change. rao_ec@yahoo.com Ubuntu 3 10-07-2009 10:29 PM
Compaq F700 (F754) screen brightness and function keys conejoroy Linux - Laptop and Netbook 4 03-27-2008 04:31 AM
Screen brightness control function keys not working. Gargle Slackware 5 07-22-2007 05:59 AM
Change brightness with Fn keys rejeep Linux - Laptop and Netbook 2 04-15-2007 03:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:11 PM.

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