[Konsole-devel] [Bug 96282] Wish: <Super> and <Hyper> prefix option

H.Peter Anvin hpa at zytor.com
Mon Jul 9 00:44:39 UTC 2007

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

------- Additional Comments From hpa zytor com  2007-07-09 02:44 -------
Absolutely.  X11 recognizes the following modifier keys: Mode_switch, Shift, Ctrl, Alt, Meta, Super, Hyper.  These can be bound to keys at will.  Mode_switch and Shift are generally used to produce additional printable character, Ctrl generates special character codes, Alt and Meta are generally treated as the same (few if any keyboards have both Alt and Meta keys), and produce an <ESC> prefix when used in a terminal; e.g. on a U.S. PC keyboard Alt-g generates "ESC g" (1b 67) ; Alt-Shift-6 generates "ESC ^" (1b 5e).

Super and Hyper are usually not bound to keys in the default configuration, but I find it useful to bind them to the otherwise useless Windoze keys.  Thus, I have Emacs macros bound to those key combinations, e.g. I can press Hyper-s to generate a "Signed-off-by:" line.  Now, when dealing with a terminal session, that has to be converted to some kind of byte sequence.  Right now, Konsole simply ignores the Super and Hyper keys, and transmit Hyper-s as just plain "s" (73).  If it instead sent "<Ctrl-X> <at> h s" (18 40 68 73) -- the 18 40 68 prefix representing the Hyper key -- then all current Emacs would handle it already.  However, any reasonable prefix would do.

The sequences that Emacs currently handles are:

"<Ctrl-X> <at> h" (18 40 68) -- Hyper prefix
"<Ctrl-X> <at> s" (18 40 73) -- Super prefix
"<Ctrl-X> <at> a" (18 40 61) -- Alt prefix
"<Ctrl-X> <at> m" (18 40 6d) -- Alt prefix
"<Ctrl-X> <at> c" (18 40 63) -- Ctrl prefix

Out of those, the Alt/Meta prefixes are pretty pointless, since it is long-since standard to instead just transmit ESC (1b) as a prefix for Alt- or Meta-keys.  The Ctrl prefix is potentially useful for combinations where the Ctrl key would normally be meaningless, e.g. Ctrl-6 could be transmitted as "18 40 63 36".

Does this make sense?

More information about the konsole-devel mailing list