LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-07-2004, 11:37 AM   #1
kayhan
Member
 
Registered: Oct 2002
Location: US
Distribution: Red Hat 7.3->9 -> Fedora Core 1
Posts: 33

Rep: Reputation: 15
Associate GNOME application with button?


On my laptop I have some nifty buttons that don't really do anything (Play, Pause, FastForward, etc.). I found their keycodes using xev, and now I would like to have it so that when I press play, xmms pops up. How do I associate the press of a button with launching an application in GNOME 2.4?

Best,
kg

[Edited to change layout 12:41 EDT 07-01-2004]

Last edited by kayhan; 01-07-2004 at 11:38 AM.
 
Old 01-07-2004, 11:46 AM   #2
BarryRadio
LQ Newbie
 
Registered: Jan 2004
Posts: 17

Rep: Reputation: 0
hi kayhan, i also have those "nifty buttons", how do U use xev to find their key codes?
 
Old 01-07-2004, 01:36 PM   #3
kayhan
Member
 
Registered: Oct 2002
Location: US
Distribution: Red Hat 7.3->9 -> Fedora Core 1
Posts: 33

Original Poster
Rep: Reputation: 15
From the command line (while running x) run

Code:
xev
and a window will pop up. Put your cursor in the window that pops up and you will notice a whole lot text flying by in the terminal. It's just telling you what "X things" are going on (mouse is going here, mouse click there, etc.) Keep the mouse still while inside the window and you can press things on the keyboard and see something like the following.

Code:
KeyPress event, serial 27, synthetic NO, window 0x3600001,
    root 0x8b, subw 0x0, time 4057122271, (29,148), root:(41,182),
    state 0x0, keycode 38 (keysym 0x61, a), same_screen YES,
    XLookupString gives 1 characters:  "a"
So it tells you that when I press the "a" on my keyboard, it sends keycode 38, which is mapped to keysym 0x61 which represents the letter "a."

I still want to know if you can an arbitrary keycode bring up an application.

[Edited to disable smilies, which I think should automatically be disabled between [CODE]-tags.]

Last edited by kayhan; 01-07-2004 at 01:39 PM.
 
Old 01-07-2004, 02:03 PM   #4
BarryRadio
LQ Newbie
 
Registered: Jan 2004
Posts: 17

Rep: Reputation: 0
i get that screen but when i press the cool buttons at the bottom of my tosiba laptop, it doesnt look like anything is sent at all
 
Old 01-07-2004, 02:19 PM   #5
kayhan
Member
 
Registered: Oct 2002
Location: US
Distribution: Red Hat 7.3->9 -> Fedora Core 1
Posts: 33

Original Poster
Rep: Reputation: 15
Toshiba, eh?

The buttons may not be recognized by X. If you're sure that your cursor is inside the new xev window (if you have focus follows mouse), then X probably doesn't recognize Toshiba's buttons. If you press the "a" on your keyboard and you get something, then you know that Toshiba's funky buttons aren't recognized. The buttons may go directly to the BIOS or may do something that is Windows-specific (such as the volume buttons on my laptop probably are).
 
Old 01-07-2004, 03:12 PM   #6
BarryRadio
LQ Newbie
 
Registered: Jan 2004
Posts: 17

Rep: Reputation: 0
yer its play, stop pause, stop. Start Windows Media etc... uses toshibas controls, so i guess it wont be reconised. o well, maybe they have a patch??
waddels over to their website
 
Old 01-07-2004, 07:15 PM   #7
kayhan
Member
 
Registered: Oct 2002
Location: US
Distribution: Red Hat 7.3->9 -> Fedora Core 1
Posts: 33

Original Poster
Rep: Reputation: 15
I hate to dampen your hopes, but Toshiba laptops are often not Linux friendly. My friend cannot access the BIOS settings of his Toshiba laptop unless he runs an executable. I advised him to try to get that running in wine, and he hasn't been heard from since!
 
Old 01-07-2004, 07:20 PM   #8
kayhan
Member
 
Registered: Oct 2002
Location: US
Distribution: Red Hat 7.3->9 -> Fedora Core 1
Posts: 33

Original Poster
Rep: Reputation: 15
I forget to mention that I was able to associate C-F1, C-F2, etc. with Mandrake 8.2 box at work. My work computer uses GNOME 1.4 (I know it's ancient), which uses Sawfish. From GNOME Control Center->Sawfish Options->Shortcuts you can associate certain actions with key presses. To get it to launch an application, pick "Run shell command" and it will open a text entry for you to put your application call. [Hint: Don't put an ampersand (&) there.]

[Edited to disable smilies. Is there a way to do this permanantly?]
 
Old 01-07-2004, 09:17 PM   #9
TheOneAndOnlySM
Member
 
Registered: Jul 2003
Location: Dallas, TX
Distribution: Ubuntu 10.04 LTS
Posts: 987

Rep: Reputation: 30
it is possible to associate multimedia keys in gnome

for me, it is under the applications menu, desktop preferences submenu, and multimedia keys option

just click the choice (such as "play") and hit your button
 
Old 01-08-2004, 02:10 PM   #10
kayhan
Member
 
Registered: Oct 2002
Location: US
Distribution: Red Hat 7.3->9 -> Fedora Core 1
Posts: 33

Original Poster
Rep: Reputation: 15
I don't have that menu structure on my Fedora Core 1 laptop. Do you know what config file this menu affects? Despite my newbie status (which changes to Member with this post, I believe), I'm much more comfortable hacking text files with emacs.
 
  


Reply


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
associate application with directory ukd Linux - Software 0 10-28-2004 10:40 AM
How I can associate the right application back to a .desktop file? carbono Red Hat 0 08-07-2004 03:36 PM
Firefox Application Button Ic38 Linux - Software 4 04-04-2004 04:35 PM
killa an application by button mouse sathia Slackware 6 11-02-2003 03:33 PM
Gnome right mouse button Sammy2ooo Linux - General 0 09-21-2003 09:26 AM


All times are GMT -5. The time now is 02:34 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration