Summary: | Wish: <Super> and <Hyper> prefix option | ||
---|---|---|---|
Product: | [Applications] konsole | Reporter: | H. Peter Anvin <hpa> |
Component: | keyboard | Assignee: | Konsole Developer <konsole-devel> |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | CC: | adaptee, kde, sergio.callegari |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | RedHat Enterprise Linux | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
H. Peter Anvin
2005-01-04 12:17:27 UTC
Still missing this one very much :( In addition to the prefixes listed in the summary, Emacs also has "^X @ m" for Meta prefix (heavily used in Emacs) and "^X @ a" for Alt prefix (not normally used in Emacs; the Alt keys on a PC keyboard are used as Meta keys.) I do not understand what this bug report is asking for. Could you clarify, bearing in mind that I am not an Emacs user. 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? Thanks, I think I understand. At the moment it appears that if I press the Super key ( which is bound to the Windows key here ) then Qt translates that as Meta. I haven't tried binding something to Hyper yet. At the moment in KDE 4 only the Alt modifier results in ESC being added as a prefix. Which means that it is possible to still make use of the Super/Windows key ( which is translated as Meta ). Qt's list of keyboard modifiers does not include Super or Hyper. This could be worked around in Konsole, but it would be much better to have it in Qt. I'll have to find the Troll to talk to. Well, an quite old report :) If I undertand it correctly, Qt still translates the super key as Qt::Key_Meta(although there are the definitions of Qt::Key_Super_L and Qt::Key_Super_R) and Qt::MetaModifier. For the hyper key, although Qt detects it as Qt::Key_Hyper_L and Qt::Key_Hyper_R, there is no corresponding Qt::HyperModifier. So the easy thing to do at the moment is to support the Super key(Qt::Key_Meta), which means adding the prefix "<Ctrl-X> <at> s (18 40 73)". But I'm not a emacs user, either. If the reporter is still watching this report, you are welcome to try the experimetal code at https://github.com/adaptee/konsole/tree/meta-modifer-prefix and leave your feedback here. Git commit 5ba344714b8da55dfcc84823abac6f059a288386 by Jekyll Wu. Committed on 24/04/2012 at 08:35. Pushed by jekyllwu into branch 'master'. Translate the "Super" modifier into bytes prefix understood by Emacs. Note: although it is Qt::MetaModifier in the code, the actual pressed key is the "Super/Windows" key. M +6 -0 src/Vt102Emulation.cpp http://commits.kde.org/konsole/5ba344714b8da55dfcc84823abac6f059a288386 please open a new report if the below commit didn't accomplish what you wanted. Please put this under a configuration option. There are some cheap laptops and dual-in-one that have weird keyboard/touchpad controllers. These controllers appear to be designed for windows and do gesture control in a particular way, by translating them into key sequences that are "standard" on windows. These keyboard sequences typically involve the windows key (which is left meta on most systems). It is not nice to have this mapped into things that are improperly understood by the shell or by other applications. Even when not on one of these machines, having this behavior hardwired in the konsole makes for hardly discoverable and confusing behaviors (see https://superuser.com/questions/1238236/super-key-combinations-cause-weird-input-in-konsole). |