emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Alternative to arrow keys (more ergonomic)?


From: Jorge A. Alfaro-Murillo
Subject: Re: [O] Alternative to arrow keys (more ergonomic)?
Date: Fri, 13 Jun 2014 10:24:15 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Martin Beck <address@hidden> writes:

>> Sorry, if it may be obvious, but how do I remap CapsLock to H
>> (Hyper)?
>> 
>
> p.s. I tried ;; remap CapsLock Key to Hyper Key ;;source:
> http://ergoemacs.org/emacs/emacs_hyper_super_keys.html ,
> http://emacs-fu.blogspot.de/2008/12/remapping-caps-lock.html (setq
> w32-enable-caps-lock nil) (global-set-key [capslock] 'hyper)

Dear Martin,

I think you should try to do that outside of emacs, in the configuration
of your system. I use Linux so I only have an answer for that.

I think the easiest way is to create a configuration file for xmodmap,
the common location and name is "~/.Xmodmap". My file looks like this:

#+BEGIN_EXAMPLE
clear control
clear lock
clear mod1
clear mod3
clear mod4

keycode 66 = Hyper_L
keycode 37 = Super_L
keycode 133 = Alt_L Meta_L
keycode 64 = Control_L
keycode 108 = Control_R
keycode 135 = Alt_R Meta_R
keycode 105 = Menu

add mod1 = Alt_R Alt_L Meta_R Meta_L
add mod3 = Hyper_L
add mod4    = Super_L
add control = Control_R Control_L
#+END_EXAMPLE

In this case I have Hyper where the CapsLock key is, and the final row
which in the keyboard is:

"Control Super Alt Space Alt MenuKey Control"

gets mapped to:

"Super Alt/Meta Control Space Control Alt/Meta MenuKey"

(which drives anyone that tries my computer nuts, but it is very
comfortable for emacs.)

The keycodes with numbers in the example are the positions of the keys
in my keyboard. This is different depending on your keyboard, so you
have to figure out yours. For that, use the program xev (in a terminal
type xev) and press the keys that you are interested to map. Between
many information it will give you the keycode for each key you press.

Once you finish with the .Xmodmap file, you can load the configuration
by typing in a terminal 'xmodmap .Xmodmap' (without the single quotes).

If you are using GDM, XDM or KDM, in particular under Gnome or KDE, the
.Xmodmap file is loaded automatically every time you start a session. If
you are not using any of those, you can modify the file ~/.xinitrc (or
~/.config/openbox/autostart in Openbox):

#+BEGIN_EXAMPLE
if [ -s ~/.Xmodmap ]; then
    xmodmap ~/.Xmodmap
fi
#+END_EXAMPLE

I hope it helps.

Best,

Jorge

PS: For linux check also XKB.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]