You are not logged in.
Pages: 1
Hi,
I'm trying to use 'xmodmap' so i can map 'ESCAPE' to work as ALT+F4 (close window). Google'd it a lot without success..
Anyone know if its possible ?
BTW: I know i can easily do this under GNOME/KDE, but i need to use xmodmap.
TIA
Last edited by spunkiie (2011-03-03 15:27:24)
Offline
This sounds like something better configured into your window manager's keybindings. What exactly are you trying to do that would require xmodmap for this instead?
Offline
Not sure if xmodmap can be used to make <escape> work like Alt + another key, though you could make <escape> work like Alt OR make it work like another key.
BUT, at least in XFCE, it is possible to redefine they keys which do commands like closing windows. One place is in settings > keyboard > application shortcuts.
The other place is settings > window manager > keyboard, and here you can specify what keys will close a window, etc.
Here are some things I found useful for xmodmap, but this may not be relevant to what you want to do.
First, a good source of info = the man pages for xmodmap, i.e. type
man xmodmap
Once you have modified the keymap with commands in a file called (say) .xmodrc, you can load it at each boot, or load it for the current session by typing the command in a console. I use a command like this in my .xinitrc file:
xmodmap ~/.xmodrc
Also useful: xmodmap -pke, xmodmap -pm (for modifier map) to see current mappings & modifier map. If you save the output from these, "diff" is useful for finding differences.
Clarification: these are two separate commands, like this:
xmodmap -pke
#output deleted
xmodmap -pm
For changing alt- keys, you may have to change the modifier map, perhaps like this:
clear mod1
#and later, after modifying bindings:
add mod1 = Alt_L
add mod1 = Alt_R
You can use xev to check key bindings.
Generally, I find it less confusing to use the "keycode" command rather than keysyms.
Last edited by btitus (2011-03-01 13:44:10)
Offline
I need to use only Xorg internal functions cuz i'm *not* using a DE or even a WM. I'm only running the Xorg server and the application (i.e: running application directly from xinitrc)
anyone ?
Offline
Applications on Linux do not use Alt+F4, it is just a binding in your DE that kills the active window.
What you want is xbindkeys and put this in your .xbindkeysrc:
"xkill"
Escape
Which turns your mouse pointer in a crosshair which will close a window.
Killing the active window is a bit trickier:
"xkill -id $(xprop -root | grep NET_ACTIVE_WINDOW\( | cut -d# -f2)"
Escape
Last edited by Procyon (2011-03-01 17:11:14)
Offline
Procyon,
Thanks for the tip.. i was trying with xvkbd without success:
"xvkbd -text "\A\[F4]" "
m:0x0 + c:9
Will try your tip now
Offline
Solved... TY guys
Offline
Pages: 1