LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Program for keybinding of Multimedia buttons on keyboard (https://www.linuxquestions.org/questions/linux-software-2/program-for-keybinding-of-multimedia-buttons-on-keyboard-144893/)

alitrix 02-11-2004 12:59 PM

Program for keybinding of Multimedia buttons on keyboard
 
Somebody got such kind of program for Linux?

Or can I just modify that in the X86Config?
You see, I have multimedia buttons at the top of my keyboard and I want to let them be supported by my PC , but I don't know how :s

So isn't there a program that checks the given key, if it equals (for example) 0x0B78 , then it should do execute 'xmms -r'

Greetz,
AliTriX

mikshaw 02-11-2004 01:06 PM

check out Xmodmap and xev
I've been contemplating this as well, since I've got a logitech internet/multimedia keyboard with 10 currently useless buttons, but haven't done any reseach yet.

alitrix 02-11-2004 03:13 PM

Problems
 
I did this:
Code:

xmodmap -e "keycode 153 = Next"

---- then ----

xev tells me this, when I push the button 153 (next number, for audio)

KeyPress event, serial 24, synthetic NO, window 0x2600001,
    root 0x3a, subw 0x0, time 24601209, (474,197), root:(509,265),
    state 0x10, keycode 153 (keysym 0xff56, Next), same_screen YES,
    XLookupString gives 0 bytes:  ""

KeyRelease event, serial 24, synthetic NO, window 0x2600001,
    root 0x3a, subw 0x0, time 24601350, (474,197), root:(509,265),
    state 0x10, keycode 153 (keysym 0xff56, Next), same_screen YES,
    XLookupString gives 0 bytes:  ""


--- then ----

dbzgt@AliTriX:~$ xmodmap -pk | grep 153
    153        0xff56 (Next) 

--- modify .fluxbox/keys ---

dbzgt@AliTriX:~$ cat .fluxbox/keys | grep Next
Mod1 Tab :NextWindow
None Next :ExecCommand xmms -f

I restart fluxbox, thought that maybe help, but still not working :(

Somebody knows why?

alitrix 02-11-2004 03:16 PM

Aaah.. shit :S

The key 'Page Down' became that execute, shit!! :'(
Can somebody tell me how I can get my PageDown back again :s?

mikshaw 02-11-2004 03:42 PM

I'm going to guess that "next" is a preset used by page down

You can most likely undo this by removing the line from .fluxbox/keys

I did some messing around and got it working with my Logitech keyboard.
You know how to find the keycode already, so I won't go into that.

locate XKeysymDB
will tell you where the keysym list is...this is a list Linux uses for your keysym names. Istead of using "Next", pick one of those for your key name. Here's what I have in my .Xmodmap:
Code:

!! Testing the Logitech extra keys
!! User
keycode 223 = XF86Start
!! Email
keycode 236 = XF86Mail
!! Messenger-SMS
keycode 145 = XF86Messenger
!! Webcam
keycode 146 = XF86WebCam
!! Mute
keycode 160 = XF86AudioMute
!! Volume +
keycode 176 = XF86AudioRaiseVolume
!! Volume -
keycode 174 = XF86AudioLowerVolume
!! Media
keycode 237 = XF86Music
!! My Home
keycode 178 = XF86Documents
!! Search
keycode 229 = XF86Search

I put "None XF86Music :ExecCommand xmms" in .fluxbox/keys, restarted the X server, and my "Media" button now launches xmms
I don't know how I'm going to set up the volume/mute buttons yet, but it'll happen...

alitrix 02-11-2004 04:01 PM

Quote:

You can most likely undo this by removing the line from .fluxbox/keys
I noticed that already ;)

And the for the tip man! It works :)
This is what I have atm:
Code:

~/.fluxbox/keys
None XF86AudioPrev :ExecCommand xmms -r
None XF86AudioPause:ExecCommand xmms -t
None XF86AudioPlay :ExecCommand xmms -t
None XF86AudioStop :ExecCommand xmms -s

Code:

Response xmodmap -pk | grep Audio
    144        0x1008ff16 (XF86AudioPrev)     
    153        0x1008ff17 (XF86AudioNext)     
    162        0x1008ff14 (XF86AudioPlay)     
    164        0x1008ff15 (XF86AudioStop)


alitrix 02-11-2004 04:24 PM

Btw, found a solution for you, for the mute and volume (+/-) keys :)

Code:

~/.fluxbox/keys/
None XF86AudioMute :ExecCommand rexima vol 0
None XF86AudioRaiseVolume :ExecCommand rexima vol +5
None XF86AudioLowerVolume :ExecCommand rexima vol -5

(I only don't know how unmute, so I get the volume I was :))

Good luck with it!

Greetz,
AliTriX

Kujila 02-11-2004 04:32 PM

Hmm, I found some interesting information here:

http://krath.dk/linux/chicony/

http://krath.dk/linux/chicony/

Hope this can help you guys, and I alike!

mikshaw 02-11-2004 05:12 PM

Quote:

Originally posted by alitrix
Btw, found a solution for you, for the mute and volume (+/-) keys :)

Code:

~/.fluxbox/keys/
None XF86AudioMute :ExecCommand rexima vol 0
None XF86AudioRaiseVolume :ExecCommand rexima vol +5
None XF86AudioLowerVolume :ExecCommand rexima vol -5

(I only don't know how unmute, so I get the volume I was :))

Good luck with it!

Greetz,
AliTriX

I'm using Alsa, so I don't know if that would work. I found something in amixer that works anyway:
None XF86AudioMute :ExecCommand amixer -q set Master toggle # mute toggle
None XF86AudioRaiseVolume :ExecCommand amixer -q set Master 1+
None XF86AudioLowerVolume :ExecCommand amixer -q set Master 1-

alitrix 02-11-2004 05:18 PM

Yes, aumix can do it as well :)
Except I don't know how it works and I don't have it on my pc, I only had rexima (Slackware 9.0)

Greetz,
AliTriX

mikshaw 02-11-2004 07:29 PM

Thanks for the nudge into something I've been meaning to check out for months...I've learned a bit, and I discovered I don't have to download and install a 5mb application to get full use out of my keyboard. And on top of that, I can customize it in ways I couldn't with the Windows Logitech software.

dave_blob 02-11-2004 09:11 PM

if you want an easy way, and your running gnome, theres a little app called 'acme' which can setup all these keys for you

charliecron 02-11-2004 10:35 PM

Use xhkeys

http://freshmeat.net/projects/xhekys/

mikshaw 02-12-2004 01:10 AM

Nothing beats a nice, clean, text file.

alitrix 02-12-2004 07:32 AM

Quote:

Originally posted by mikshaw
Nothing beats a nice, clean, text file.
I full agree with you :)
I just love to custom it on my own why, without any programs ;)


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