emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: jorge.a.alfaro@gmail.com (Jorge A. Alfaro-Murillo)
To: emacs-orgmode@gnu.org
Subject: Re: Alternative to arrow keys (more ergonomic)?
Date: Fri, 13 Jun 2014 10:24:15 -0400	[thread overview]
Message-ID: <87d2eckhv4.fsf@gmail.com> (raw)
In-Reply-To: loom.20140613T093205-939@post.gmane.org

Martin Beck <elwood151@web.de> 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	other threads:[~2014-06-13 14:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-12 14:00 Alternative to arrow keys (more ergonomic)? Martin Beck
2014-06-12 14:41 ` Jorge A. Alfaro-Murillo
2014-06-12 14:45   ` Thorsten Jolitz
2014-06-12 15:19     ` Jorge A. Alfaro-Murillo
2014-06-12 17:24       ` Thorsten Jolitz
2014-06-13  7:18   ` Martin Beck
2014-06-13  7:33     ` Martin Beck
2014-06-13 14:24       ` Jorge A. Alfaro-Murillo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d2eckhv4.fsf@gmail.com \
    --to=jorge.a.alfaro@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).