[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Alternative to arrow keys (more ergonomic)?
From: |
Thorsten Jolitz |
Subject: |
Re: [O] Alternative to arrow keys (more ergonomic)? |
Date: |
Thu, 12 Jun 2014 19:24:33 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
address@hidden (Jorge A. Alfaro-Murillo) writes:
> Thorsten Jolitz <address@hidden> writes:
>
>> Just out of curiosity - did you try this on the console (without X) too?
>
> Xmodmap does not work without X, at least I suppose that is what the X
> stands for =)
I know, thats why I asked.
> If someone knows how to remap outside of X please let me know.
In Archlinux, I copied console keymap
,---------------------
| de-latin1-nodeadkeys
`---------------------
adapted it to my emacs needs, saved it and put
,----------------------------------
| KEYMAP=de-latin1-nodeadkeys-emacs
`----------------------------------
in my /etc/vconsole.conf.
It looks somehow like this:
,--------------------------------------------------------------------------------------
| # de-latin1-nodeadkeys-emacs.map: German keymap with special keybindings for
Emacs
|
| include "de-latin1.map"
|
| # control keycode 7 = Control_asciicircum
| keycode 13 = apostrophe grave
| keycode 27 = plus asterisk asciitilde
| # keycode 41 = asciicircum degree
|
| # corresponding keys in de-latin1.map:
| # keycode 13 = dead_acute dead_grave
| # keycode 27 = plus asterisk dead_tilde
| # keycode 41 = dead_circumflex degree
|
| # unterste Zeile:
| keycode 29 = AltGr AltGr AltGr AltGr
| [...]
| etc etc
`--------------------------------------------------------------------------------------
Would be interesting if (and how) it works to actually define and use a
hyper-key on the console, because even the standard modifiers like C-,
M- and don't always work, especially when combined (see 'org on a
tty' in the manual) or in combination with S-.
> Since I use emacs not in X in my phone, my workaround is to create a
> hyper key in another place (F6 is a good place for the keyboard of
> JuiceSSH in Android). It is not really a modifier, so to press 'H-j',
> you actually do 'F6 j', that is 'F6' followed by 'j', but I guess that
> is as good as you can get with a keyboard onscreen without installing a
> super tiny keyboard (e.g. Hacker's Keyboard).
>
> #+BEGIN_SRC emacs-lisp
> (defun hyperify (prompt)
> (let ((e (read-event)))
> (vector (if (numberp e)
> (logior (lsh 1 24) e)
> (if (memq 'hyper (event-modifiers e))
> e
> (add-event-modifier "H-" e))))))
>
> (defun add-event-modifier (string e)
> (let ((symbol (if (symbolp e) e (car e))))
> (setq symbol (intern (concat string
> (symbol-name symbol))))
> (if (symbolp e)
> symbol
> (cons symbol (cdr e)))))
>
> (define-key key-translation-map (kbd "<f6>") 'hyperify)
> #+END_SRC
sounds interesting ...
--
cheers,
Thorsten