LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 05-23-2007, 10:23 AM   #1
ernesto_cgf
Member
 
Registered: Nov 2003
Location: Havana, Cuba
Distribution: Ubuntu 9.04 "Jaunty Jackalope"
Posts: 153

Rep: Reputation: 30
special multimedia keys and mpd


I'd like to know if there's some way for me to make my special multimedia keys on my keyboard (play/pause, next, previous, stop, volume up & down, mute) to control my music player daemon (mpd).

I am using gnome on ubuntu feisty and mpc, sonata or gimmix as my main mpd clients.

If I could only bind these keys to the appropiate mpc command, like

Code:
mpc toggle   # for play/pause
mpc next     # for switching to the next song
mpc prev     # for switching to the previous song
mpc stop     # to stop
             # ...and so on
But I do not know how to make gnome bind some key to a specific command. Is there some way to do this? Please, help me.
 
Old 05-23-2007, 05:49 PM   #2
Brian1
Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 61
Never experimented with multimedia keys with Gnome only with KDE.
Check out xbindkeys program for starters.

Now lets see if the keys can be seen. Run the tool called ' xev ' from the command line. Press the keys and note the keycodes it shows if they are detected.
Now look in your /etc/X11/Xmodmap file. I have this in mine to map some keys to KDE.
keycode 176 = XF86AudioRaiseVolume
keycode 174 = XF86AudioLowerVolume
keycode 178 = XF86WWW
keycode 236 = XF86Mail

To see the list of other XF86 references look for this file on your machine. XF86keysym.h
Maybe here /usr/include/X11/XF86keysym.h
Or Here /usr/X11R6/include/X11/XF86keysym.h

Search the forum here there is lots on this. Also do an advance search using my username here. I have a few post with many ideas. But I have the feeling xbinkeys is what will be the easiest to get going than all the manual setups like I did.

Brian

Last edited by Brian1; 05-23-2007 at 05:54 PM.
 
Old 05-23-2007, 07:21 PM   #3
mect
LQ Newbie
 
Registered: Feb 2006
Posts: 1

Rep: Reputation: 0
With gnome, you should be able to go to keyboard layouts (I believe its under regional settings) and choose from a list. Even if your keyboard model isn't listed, one of the others will often work. Thats the easiest fix without playing around with programs like xbindkeys.
 
Old 05-24-2007, 06:00 PM   #4
ernesto_cgf
Member
 
Registered: Nov 2003
Location: Havana, Cuba
Distribution: Ubuntu 9.04 "Jaunty Jackalope"
Posts: 153

Original Poster
Rep: Reputation: 30
Thanks both for your replies, but you have misunderstood my problem.
I am able to bind keys to the actions gnome provide me. The problem is that the multimedia keys specifically (play/pause, stop, next, previous) act against rythmbox instead of my audio player of choice (sonata + mpd). Since I do not start rythmbox nothing happens when I press these keys.

What I need is either a way to tell gnome what's my preferred media player, or maybe it's best to make my system execute an arbitrary command when a key is pressed. This way I could bind those keys to the appropriate mpc command. (MPC is the command line client to MPD).

So I guess I'll checkout xbindkeys, which I am installing as we speak. I'll let you know if it works.
 
Old 05-25-2007, 06:59 PM   #5
Brian1
Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 61
Never used either sound apps but does the play already have a shortcut key? In some apps when you look under file or other tabs it list actions related to the tab. Sometimes they list shortcut keys to the action. Example is like Firefox. Click on edit and Undo can be done with ctrl-z. Not sure if this applies to those apps. I think if they can then mapping the keycode to the those keys might get. Xbindkeys I think can do it.

Brian
 
  


Reply

Tags
gnome, keyboard, mpd, multimedia


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
'Special' Keyboard Keys on Linux ninjabob7 Linux - Hardware 4 02-20-2006 04:13 PM
Special keyboard keys rdabra Linux - Newbie 3 01-04-2006 06:01 AM
special keys of laptop alinsoar Linux - Laptop and Netbook 2 11-01-2005 03:40 PM
Multimedia keys killerbob Slackware 2 05-20-2005 10:21 PM
Special Keys raven Linux - Laptop and Netbook 0 10-16-2003 10:21 AM


All times are GMT -5. The time now is 04:20 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration