Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Mapping custom commands to keysrokes...
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
zenon
Apprentice
Apprentice


Joined: 09 Oct 2002
Posts: 263

PostPosted: Sat Jan 25, 2003 2:08 am    Post subject: Mapping custom commands to keysrokes... Reply with quote

I tried the archives and they seem pretty dry in this area so...

I have these 2 totally useless keys sitting on my keyboard that Mr Gates insited I must have, namely the window and ???? keys. I think you all know what 2nd key I'm talking about, that one even Mr Gates couldn't find a use for, does it do anything?

I am a KDE user and I'd like to map the windows key to the [Alt]+[F1] keystroke, can this be done stock, or do I need to download some kind of software?

Also, NE know where I can buy a key with a Penguin printed on it vs. this flying turd?

Peace.
Back to top
View user's profile Send private message
sessionID
Apprentice
Apprentice


Joined: 11 Nov 2002
Posts: 266
Location: hungary

PostPosted: Sat Jan 25, 2003 10:54 am    Post subject: Reply with quote

Put this in ~/.Xmodmap:

Code:

keycode 115 = Super_L
add mod4 = Super_L
keycode 64 = Alt_L
add mod1 = Alt_L

remove Lock = Caps_Lock


(The last line is not needed, but CapsLock drives me mad...)

Than You can bind anything to win+somekey in kde control center.
Back to top
View user's profile Send private message
nempo
Guru
Guru


Joined: 16 Apr 2002
Posts: 360
Location: Linkoping, Sweden

PostPosted: Sat Jan 25, 2003 2:04 pm    Post subject: Reply with quote

How would one do this in gnome ?
the help files says to add custom stuff in your 'keyboard-shortcuts' settings by pressing the 'add' button or something....there is no 'add' button
Back to top
View user's profile Send private message
nocternal
n00b
n00b


Joined: 08 Feb 2003
Posts: 29
Location: Winnioeg, MB, Canada

PostPosted: Thu Dec 11, 2003 10:36 pm    Post subject: Reply with quote

Hi,

I created ~.Xmodmap and made the entries as shown above. Now I can map the right-side windows key as wanted. I used ´xev' and noticed that the left windows key is scancode 115 and the right-windows key is scancode 116.

Has anyone else had the same problems -- not being able to map the left windows key -- but only the right windows key?

Using 2.4.40-gentoo-r6 compiled using genkernel, Gnome 2.4. Completed an emerge sync and emerge world last night... so everything is up to date. I did not have the windows key setup prior to trying it today... so the updating did not break a working setup for me.

Any help would be great! :)
Back to top
View user's profile Send private message
Andersson
Guru
Guru


Joined: 12 Jul 2003
Posts: 525
Location: Göteborg, Sweden

PostPosted: Thu Dec 11, 2003 11:54 pm    Post subject: Reply with quote

Do you really need to edit ~/.Xmodmap for those buttons? When I press the left win key, xev reports the keycode 115, but also the name Super_L, without me doing anything.

KeyRelease event, serial 29, synthetic NO, window 0x1800001,
root 0x38, subw 0x0, time 36648839, (89,89), root:(772,451),
state 0x50, keycode 115 (keysym 0xffeb, Super_L), same_screen YES,
XLookupString gives 0 bytes: ""

I use this name, Super_L, in the config file of my window manager to map the key to a function. It works perfectly. What program do you use for the actual mapping? Your window manager (which one?) or a special program? And what is exact the problem you run into?
Back to top
View user's profile Send private message
Ricky
Guru
Guru


Joined: 30 May 2003
Posts: 341

PostPosted: Fri Dec 12, 2003 4:49 am    Post subject: Reply with quote

nempo wrote:
How would one do this in gnome ?
the help files says to add custom stuff in your 'keyboard-shortcuts' settings by pressing the 'add' button or something....there is no 'add' button


You can add commands using GConf editor. (Applications>System Tools>Configuration editor)

open up /apps/metacity and you can set the commands under keybinding_commands and the actual keybindings in global_keybindings (setting the values in the keys run_command_#)
Back to top
View user's profile Send private message
nocternal
n00b
n00b


Joined: 08 Feb 2003
Posts: 29
Location: Winnioeg, MB, Canada

PostPosted: Fri Dec 12, 2003 11:18 pm    Post subject: Reply with quote

Thanks for the responses BTW!

Thanks, Ricky.... that worked!

Yes, you are correct... the keys are all mapped properly (without intervention) according to xev (Super_L, MultiKey and Menu for L-,R-Windows and menu keys respectively).

This is what the left windows key spits out - scancode 115:

KeyRelease event, serial 25, synthetic NO, window 0x2800001,
root 0x48, subw 0x0, time 2244223, (148,349), root:(166,415),
state 0x40, keycode 115 (keysym 0xffeb, Super_L), same_screen YES,
XLookupString gives 0 bytes: ""

For some reason using Application --> Desktop Preferences --> Keyboard Shortcuts it would not read Super_L when I pressed the left windows key -- but it would register both Multi_Key )R-Windows) and Menu (button next to R-windows key).

Andersson,

I use whatever the stock `emerge gnome` compiles. I believe that´s metacity for the wm? Sorry I have not spent a ton of time with GUI configs for Linux... been spending far too much time on the command line only!

After mapping it manually it works.

Thanks for all your help folks! :)
Back to top
View user's profile Send private message
ang
n00b
n00b


Joined: 30 Jan 2003
Posts: 29

PostPosted: Sun Dec 14, 2003 1:06 pm    Post subject: Reply with quote

maybe xindkeys is your choice
Back to top
View user's profile Send private message
wishkah
Guru
Guru


Joined: 09 May 2003
Posts: 441
Location: de

PostPosted: Tue Dec 30, 2003 9:53 am    Post subject: Reply with quote

ang wrote:
maybe xindkeys is your choice


Man, I was looking for something like this for a looong time, since I use fluxbox. These two make a great team.
_________________
if only I could fill my heart with love...
Back to top
View user's profile Send private message
kev82
n00b
n00b


Joined: 13 Feb 2004
Posts: 26

PostPosted: Thu Mar 18, 2004 1:23 pm    Post subject: Reply with quote

Sorry for bringing this thread up so long after it was last posted to, but where can i get this 'xindkeys' thingie?

I'm having trouble mapping the volume buttons on my laptop to raising and lowering the volume and thought this might be the answer...?
Back to top
View user's profile Send private message
Pozac
n00b
n00b


Joined: 08 Aug 2002
Posts: 64
Location: Denmark

PostPosted: Thu Mar 18, 2004 2:05 pm    Post subject: Reply with quote

He meant to write 'xbindkeys' i guess...
Back to top
View user's profile Send private message
kev82
n00b
n00b


Joined: 13 Feb 2004
Posts: 26

PostPosted: Thu Mar 18, 2004 6:04 pm    Post subject: Reply with quote

Ah of course, stupid me :)

Thank you :)
Back to top
View user's profile Send private message
yngwin
Retired Dev
Retired Dev


Joined: 19 Dec 2002
Posts: 4572
Location: Suzhou, China

PostPosted: Thu Mar 18, 2004 6:10 pm    Post subject: Reply with quote

Or try KHotKeys
Back to top
View user's profile Send private message
kev82
n00b
n00b


Joined: 13 Feb 2004
Posts: 26

PostPosted: Thu Mar 18, 2004 10:14 pm    Post subject: Reply with quote

I'm using fluxbox, so kde apps are out of the question, I guess :)
Back to top
View user's profile Send private message
Sir Alaran
Apprentice
Apprentice


Joined: 11 Dec 2003
Posts: 182
Location: KSJC

PostPosted: Fri Mar 19, 2004 12:16 am    Post subject: Reply with quote

A quick little how-to on xbindkeys:

Type
Code:
 xbindkeys -k


And then press a key. For my Windows key the output is

Code:
 m:0x10 + c:115


Then create a file called " .xbindkeysrc" in your /home/you folder and put the following in it (as an example)

Code:

"xterm"
m:0x0 + c:115


This will bring up an xterm whenever you press the key.

My preferance is to do the following:
Add this line to the .xbindkeysrc
Code:

"sh /home/me/bin/terminal"
m:0x0 + c:115


And make a terminal script as follows...
Code:

#!/bin/bash

terminalactivated=`pidof -s Eterm`
if [ $terminalactivated ]
then
   kill `pidof -s  Eterm`
else
   terminalactivated = 1
   Eterm --scrollbar false --borderless false --xterm-select --trans true --shade 50
   --iconic false --buttonbar false --cursor-color white
fi


This opens an Eterm with my favorite options and closes it when I press the key again.
Use xbindkeys. If you change window managers you won't lose anything. My metacity/GNOME stuff doesn't work in XFCE4. (Not that I expected it to)
_________________
D is awesome.
Textadept is my friend.
Back to top
View user's profile Send private message
ogre2112
n00b
n00b


Joined: 30 Nov 2003
Posts: 60
Location: East Coast, USA

PostPosted: Sun Mar 21, 2004 7:54 pm    Post subject: Reply with quote

For the record, that "other" key is the right-click, or context menu key. It can be very handy when you're working on a Windows system without a mouse.
_________________
(= I smile because I have no idea what's going on =)
Back to top
View user's profile Send private message
n4than
Tux's lil' helper
Tux's lil' helper


Joined: 15 Jan 2004
Posts: 100

PostPosted: Mon Mar 29, 2004 11:44 pm    Post subject: Reply with quote

Anyone use FN keys on a laptop keyboard?
i try xbindkey and xev, but the combination of FN + some of Fx key does not give me any result ! :cry:

any idea ?
Back to top
View user's profile Send private message
bhartin
n00b
n00b


Joined: 08 May 2002
Posts: 21

PostPosted: Fri Apr 23, 2004 11:19 pm    Post subject: Reply with quote

n4than wrote:
Anyone use FN keys on a laptop keyboard?
i try xbindkey and xev, but the combination of FN + some of Fx key does not give me any result ! :cry:

any idea ?


On my laptop, at least, the Fn key doesn't register as an X event. Unless you have a special 'hotkey' type driver for your laptop (I think ones exist for Toshiba and Compaq), then you probably can't use it. The laptop's hardware grabs this key directly--the operating system can't possibly see it--again, at least from my experience.
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