View previous topic :: View next topic |
Author |
Message |
Necro n00b
Joined: 25 Jul 2004 Posts: 19
|
Posted: Sun Jul 25, 2004 2:08 am Post subject: mapping keys to custom scripts |
|
|
So I have a logitec keybaord with some multi media keys
I got the volume keys (vol up, vol down, mute) working after searching the internet a little
now i need to get the play/pause, next, prev and stop button to work
I use xmms and i would like to map those keys to a self made script that communicates with xmms through pipes
the pipes are already working
i just cant seem to figure out how to map the keys to the scripts
any help on this would be very much appreciated |
|
Back to top |
|
|
soulwarrior Guru
Joined: 21 Oct 2002 Posts: 331
|
Posted: Sun Jul 25, 2004 2:21 am Post subject: |
|
|
Lineak should do the trick. Had once used this program on my laptop to use the multimedia-keys. |
|
Back to top |
|
|
malone Apprentice
Joined: 19 Feb 2004 Posts: 159 Location: The p-n junction.
|
Posted: Sun Jul 25, 2004 4:53 am Post subject: |
|
|
Any chance you would post your scripts? I've been using the itouch plugin for xmms (it's in portage), but am interested in other solutions.
Cheers. _________________ malone |
|
Back to top |
|
|
soulwarrior Guru
Joined: 21 Oct 2002 Posts: 331
|
Posted: Sun Jul 25, 2004 10:29 am Post subject: |
|
|
Because I have an Presario 920EA, I followed the instructions found on Linux on a Compaq Presario 905EA:
Quote: |
* Extra (inet/mmedia) keys: work
Install LinEAK (the version that comes with Debian SID is ok). Copy this lineakkb.def file over the one you'll have in /etc/, launch lineakd and configure your keys with lineakconfig. For more information about installing/configuring/using LinEAK, check its docs.
There are other ways to manage these keys. For example, GNOME 2.2 provides its own multimedia-keys daemon with a nifty graphic interface. KDE may include a similar program, too.
|
There you will also find the link to the corresponding lineakkb.def file. |
|
Back to top |
|
|
Necro n00b
Joined: 25 Jul 2004 Posts: 19
|
Posted: Sun Jul 25, 2004 11:23 am Post subject: |
|
|
yea, i know lineak would do the trick :p
but i'm very supborn and want to do it myself :p
btw, those scipts are very very simple
all they would do is something like this: "echo play > ~/.xmms/inpipe"
or: "echo next > ~/.xmms/inpipe" |
|
Back to top |
|
|
Necro n00b
Joined: 25 Jul 2004 Posts: 19
|
Posted: Sun Jul 25, 2004 11:39 am Post subject: |
|
|
I think it can be done by editing this file: /etc/X11/xkb/compat/xfree86
well, the dir would be the same, but the file will differ depending on what keybaord layout and stuff you have
now the only prob is that i dont know what the heck I'm supposed to add there :p |
|
Back to top |
|
|
Necro n00b
Joined: 25 Jul 2004 Posts: 19
|
Posted: Mon Jul 26, 2004 12:27 pm Post subject: |
|
|
so ... any of you got an idea? |
|
Back to top |
|
|
Sir Alaran Apprentice
Joined: 11 Dec 2003 Posts: 182 Location: KSJC
|
Posted: Mon Jul 26, 2004 9:09 pm Post subject: |
|
|
Have you tried xbindkeys? I believe it uses scancodes from the keyboard and will therefore pick up pretty much anything.
Then run it with the -k option to see if it detects your keys.
A little window will pop up. Press your key and see if it sees anything.
If it does, create a file in your $HOME directory called .xbindkeysrc.
Code: | (vim/emacs/scite/nano/whatever) ~/.xbindkeysrc |
Then write a file like this:
Code: |
"xterm"
m:0x0 + c:115
|
Where xterm is the command you want to run and "m:0x0 + c:115" is the code that you got from the earlier step. This example makes the Windows key launch an xterm.
When the config file is written, run the program.
Press your key and see if it works. _________________ D is awesome.
Textadept is my friend. |
|
Back to top |
|
|
|