ratpoison escape key

You have a problem with Salix? Post here and we'll do what we can to help.
Post Reply
User avatar
mimosa
Salix Warrior
Posts: 3311
Joined: 25. May 2010, 17:02
Contact:

ratpoison escape key

Post by mimosa »

The standard is C-t, which I have changed to 'Menu'.

The 'Windows key' isn't an entirely viable alternative, because it seems to want to behave like a dead key, i.e. it expects a different key to be pressed after it. In most cases this is fine, but the way I use ratpoison, one of the most frequent sequences in my workflow is to press it twice to go to the previously active (not sequentially previous or next) window, and then the same again to get back where I was (no, that pesky email still hasn't arrived, back to reading the paper).

I just dug an old Mac keyboard out of the cupboard, and although it doesn't seem to have the 'Menu' key, it doe shave two 'Apple' keys, which behave like the Windows ones.

My question is, is this behaviour hardwired, or can I circumvent it, either by fiddling with the keymap, or ratpoisonrc? As it is, these two keys are a waste of prime keyboard real estate.
User avatar
gapan
Salix Wizard
Posts: 6241
Joined: 6. Jun 2009, 17:40

Re: ratpoison escape key

Post by gapan »

You can use xev to detect the keycode for those keys. The win key on a PC keyboard has keycode 133. You could then map that keycode to any key you want using xmodmap. I suggest you use something like F13, which is not usually an actual key on a keyboard. Then in ratpoison, set F13 as the escape key.

This should be helpful: https://wiki.archlinux.org/index.php/Xmodmap
Image
Image
User avatar
mimosa
Salix Warrior
Posts: 3311
Joined: 25. May 2010, 17:02
Contact:

Re: ratpoison escape key

Post by mimosa »

Thanks, I think that will get me there - the concept of the 'keysym'. This (linked to from that Arch wiki page) is also very helpful:
http://dev-loki.blogspot.lt/2006/04/map ... odmap.html

Note especially this nice bit of fancy footwork with sed, to get less verbose output from xev:

Code: Select all

xev | grep -A2 --line-buffered '^KeyRelease' | sed -n '/keycode /s/^.*keycode \([0-9]*\).* (.*, \(.*\)).*$/\1 \2/p'
At the moment, I am setting the X keyboard layout in .xinitrc; I can just move that line to before .Xmodmap is applied, but I might as well do this globally (as if I had set it on installation). Where is the proper place to do this?
EDIT In answer to my own question ... here:

Code: Select all

/etc/X11/xorg.conf.d/10-keymap.conf
User avatar
gapan
Salix Wizard
Posts: 6241
Joined: 6. Jun 2009, 17:40

Re: ratpoison escape key

Post by gapan »

Right. If you're using gdm, you can also run any commands in /etc/gdm/Init/custom.
Image
Image
Post Reply