Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
mapping keys to custom scripts
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
Necro
n00b
n00b


Joined: 25 Jul 2004
Posts: 19

PostPosted: Sun Jul 25, 2004 2:08 am    Post subject: mapping keys to custom scripts Reply with quote

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 :D
Back to top
View user's profile Send private message
soulwarrior
Guru
Guru


Joined: 21 Oct 2002
Posts: 331

PostPosted: Sun Jul 25, 2004 2:21 am    Post subject: Reply with quote

Lineak should do the trick. Had once used this program on my laptop to use the multimedia-keys.
Back to top
View user's profile Send private message
malone
Apprentice
Apprentice


Joined: 19 Feb 2004
Posts: 159
Location: The p-n junction.

PostPosted: Sun Jul 25, 2004 4:53 am    Post subject: Reply with quote

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
View user's profile Send private message
soulwarrior
Guru
Guru


Joined: 21 Oct 2002
Posts: 331

PostPosted: Sun Jul 25, 2004 10:29 am    Post subject: Reply with quote

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
View user's profile Send private message
Necro
n00b
n00b


Joined: 25 Jul 2004
Posts: 19

PostPosted: Sun Jul 25, 2004 11:23 am    Post subject: Reply with quote

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
View user's profile Send private message
Necro
n00b
n00b


Joined: 25 Jul 2004
Posts: 19

PostPosted: Sun Jul 25, 2004 11:39 am    Post subject: Reply with quote

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
View user's profile Send private message
Necro
n00b
n00b


Joined: 25 Jul 2004
Posts: 19

PostPosted: Mon Jul 26, 2004 12:27 pm    Post subject: Reply with quote

so ... any of you got an idea?
Back to top
View user's profile Send private message
Sir Alaran
Apprentice
Apprentice


Joined: 11 Dec 2003
Posts: 182
Location: KSJC

PostPosted: Mon Jul 26, 2004 9:09 pm    Post subject: Reply with quote

Have you tried xbindkeys? I believe it uses scancodes from the keyboard and will therefore pick up pretty much anything.
Code:
emerge xbindkeys

Then run it with the -k option to see if it detects your keys.
Code:
xbindkeys -k

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.
Code:
xbindkeys

Press your key and see if it works.
_________________
D is awesome.
Textadept is my friend.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum