Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Kernel & Hardware
  • Search

laptop volume buttons to function at console

Kernel not recognizing your hardware? Problems with power management or PCMCIA? What hardware is compatible with Gentoo? See here. (Only for kernels supported by Gentoo.)
Post Reply
Advanced search
9 posts • Page 1 of 1
Author
Message
mizery de aria
Guru
Guru
Posts: 309
Joined: Sun Dec 07, 2003 9:23 am

laptop volume buttons to function at console

  • Quote

Post by mizery de aria » Sun Jan 23, 2005 11:13 am

I'd like to be able to use my laptop's volume control buttons to adjust the volume of my laptop using amixer. I can configure X appropriately for such tasks/behaviors, however, I'm uncertain as to how to do so at a console/terminal. Any suggestions or ideas?
Last edited by mizery de aria on Wed Jan 26, 2005 12:45 pm, edited 2 times in total.
Do not repIy to or othErwise communicate with me if you use religious, spiritual or similar terminologies or references in your typings.
Top
BlinkEye
Veteran
Veteran
Posts: 1046
Joined: Tue Oct 21, 2003 7:13 pm
Location: Gentoo Forums

  • Quote

Post by BlinkEye » Sun Jan 23, 2005 11:26 am

i guess you tried without configuring anything?! i thought that usually such buttons are controlled by the hardware itself, at least my buttons and even suspend to ram are controlled this way. all i had to do was disabling ACPI and using APM. so, i set my volumes in alsamixer to maximum power but change the volume with these keys (they don't affect the alsamixer volume settings).
Easily backup up your system? klick
Get rid of SSH Brute Force Attempts / Script Kiddies klick
Top
mizery de aria
Guru
Guru
Posts: 309
Joined: Sun Dec 07, 2003 9:23 am

  • Quote

Post by mizery de aria » Sun Jan 23, 2005 1:45 pm

Someone suggested I do this...
I stopped acpid

Code: Select all

/etc/init.d/acpid stop
I then monitored /proc/acpi/event while pushing the volume buttons

Code: Select all

cat /proc/acpi/event
nothing...no response...
however I had already determined that the following captures the volume button presses...

Code: Select all

cat /dev/input/event2
and I had already determined the keycodes of the keypresses

Code: Select all

showkey
kb mode was XLATE

press any key (program terminates 10s after last keypress)...
keycode  28 release
#Pushing decrease volume button results in
keycode 114 press
keycode 114 release
#Pushing mute volume button results in
keycode 113 press
keycode 113 release
#Pushing increase volume button results in
keycode 115 press
keycode 115 release
/usr/share/keymaps/i386/qwerty/defkeymap.map.gz contains:

Code: Select all

...
keycode  59 = F1               F13              Console_13
keycode  60 = F2               F14              Console_14
...
keycode 113 = F13
keycode 114 = F14
keycode 115 = Help
...
string F13 = "\033[25~"
string F14 = "\033[26~"
...
Any ideas on what to do from here?
Do not repIy to or othErwise communicate with me if you use religious, spiritual or similar terminologies or references in your typings.
Top
mizery de aria
Guru
Guru
Posts: 309
Joined: Sun Dec 07, 2003 9:23 am

  • Quote

Post by mizery de aria » Sun Jan 23, 2005 2:22 pm

hrmm, with the default config as is (as documented above) I have noticed that at a console/terminal pushing the volume decrease button results in a "~" being printed (but appended as input to be executed...not inputted or executed as a command)...same applies when the volume mute button is pushed. However nothing happens when the volume increase is pushed.

However the reason for that is because there is no line in /usr/share/keymaps/i386/qwerty/defkeymap.map.gz such as

Code: Select all

string Help = "echo hi"
in which if there were a line then "echo hi" would be appended to the console awaiting for further input...but alas, not executed as a command like I want it to...

Just a note, I did the following to realize what I mentioned above:

Code: Select all

#create a file such as /tmp/keymap
#add the following lines to /tmp/keymap where keycode 115 is for a particular button you are pushing (in my case it's my volume increase button)
keycode 115 = VolInc
string VolInc = "echo hi"
#save then exec the following line
loadkeys /tmp/keymap
#then push the button and you'll see what I mean...
Basically, I need to determine how to have such values for the strings become executable when the button is pushed... Any suggestions on that?
Do not repIy to or othErwise communicate with me if you use religious, spiritual or similar terminologies or references in your typings.
Top
mizery de aria
Guru
Guru
Posts: 309
Joined: Sun Dec 07, 2003 9:23 am

  • Quote

Post by mizery de aria » Sun Jan 23, 2005 2:51 pm

yay..twas a simple solution after all...

/tmp/keymap:

Code: Select all

keycode 113 = F13
keycode 114 = F14
keycode 115 = Help
string F13 = "echo volume mute button pushed\n"
string F14 = "echo volume decrease button pushed\n"
string Help = "echo volume increase button pushed\n"
then exec the following:

Code: Select all

loadkeys /tmp/keymap
Then simply push your buttons...however one thing I noticed is that scrolling back through previous commands includes such string values from each button press...eh, oh well...and yes, don't forget to change the string values to whatever yuo desire

Also, it'd be nice to have better keysyms to use, but alas I'm not sure of any that are related to volume control buttons...
Do not repIy to or othErwise communicate with me if you use religious, spiritual or similar terminologies or references in your typings.
Top
mizery de aria
Guru
Guru
Posts: 309
Joined: Sun Dec 07, 2003 9:23 am

  • Quote

Post by mizery de aria » Wed Jan 26, 2005 12:45 pm

actually, my solution isn't really a solution after all since when at a terminal I must be logged in and not having any program running...
Is it possible to have buttons execute a program beyond at the terminal/console?
Do not repIy to or othErwise communicate with me if you use religious, spiritual or similar terminologies or references in your typings.
Top
Remenic
Tux's lil' helper
Tux's lil' helper
Posts: 76
Joined: Sat May 10, 2003 6:27 pm

  • Quote

Post by Remenic » Wed Jan 26, 2005 1:55 pm

I almost opened a new topic on this very issue. What a coincidence :)

I haven't found a solution yet, though... But if I find it, I will report here.
Top
Nargule
n00b
n00b
Posts: 22
Joined: Tue Jan 25, 2005 12:14 pm
Location: Gainesville, FL
Contact:
Contact Nargule
Website

  • Quote

Post by Nargule » Fri Jan 28, 2005 6:26 am

I wanted my laptop console buttons to adjust the volume too, and in searching the forum I came up with a simple solutiion.

1) I emerged hotkeys

2) Using xev, I figured out the keycodes (note, the keycodes I got from showkey were different, the xev codes are the ones that worked for me)

3) Following the hotkeys man, I created a new device and called the file presarioX1000.def:

Code: Select all

<definition>
  <config model="Compaq Presario X1000">
     <VolUp keycode="176"/>
     <VolDown keycode="174"/>
     <Mute keycode="160"/>
   </config>
   <contributor>
      <name>Tom Corwine</name>
      <email>hotkeys@corwine.org</email>
   </contributor>
</definition>
4) I modified the hotkeys.conf:

Code: Select all

############################################################
# Global configuration for hotkeys                         #
############################################################

# These are the default values.
# A line starting with # is a comment.

### Specify the default keyboard  (without the .def extension) so you
### don't need to specify -t every time
Kbd=presarioX1000
# CDROM=/dev/cdrom

# Audio stuff added by Tom Corwine

VolUp=amixer set Master 2+
VolDown=amixer set Master 2-
Mute=amixer set Master toggle

# End stuff added by Tom Corwine

# PrevTrack=xmms --rew
# Play=xmms --play-pause
# Stop=xmms --stop
# Pause=xmms --pause
# NextTrack=xmms --fwd
# Rewind=

# WebBrowser=mozilla
# Email=mozilla -mail
# Calculator=xcalc
# FileManager=gmc
# MyComputer=gmc
# MyDocuments=gmc
# Favorites=gnome-moz-remote --remote=openBookmarks
# Transfer=gtp
# Record=grecord
# Shell=xterm -rv
# ScreenSaver=xscreensaver-command -activate
# NewsReader=mozilla -news
# Communities=mozilla -remote 'openURL(http://slashdot.org)'
# Search=mozilla -remote 'openURL(http://google.com)'
# Idea=mozilla -remote 'openURL(http://sourceforge.net)'
# Shopping=mozilla -remote 'openURL(http://thinkgeek.com)'
# Go=mozilla -remote 'openURL(http://linux.com)'
# Print=lpr
# Rotate=

# osd_font=-arphic-ar pl kaitim big5-bold-i-normal--0-250-0-0-c-0-*-*
### For the color, you can either use the strings in /etc/X11/rgb.txt,
### or use the RGB syntax #RRGGBB, e.g. ##A086FF
# osd_color=LawnGreen
# osd_timeout=3
### osd_position is either 'top' or 'bottom'
# osd_position=bottom
# osd_offset=25
5) Then I modified my .xintrc to start hotkeys -Z when X starts. The -Z switch surpresses the splash screen.

Hope this helps someone. Now all I have to do is figure out how to get the "mute" LED to light up.
Nargule
Top
elestedt
Guru
Guru
Posts: 383
Joined: Sun Mar 13, 2005 6:16 pm

  • Quote

Post by elestedt » Thu Sep 08, 2005 6:57 pm

Nargule wrote:Hope this helps someone. Now all I have to do is figure out how to get the "mute" LED to light up.
If your alsamixer shows a external emplifier - try toggling it to see if it lights up, it does for me (HP nw8240).
Top
Post Reply

9 posts • Page 1 of 1

Return to “Kernel & Hardware”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic