Ticket #4139 (closed enhancement: invalid)
Make McEdit recognize the alt-ctrl-… keys
Reported by: | psprint | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | mc-tty | Version: | master |
Keywords: | keybindings, bindings, keys, mappings | Cc: | |
Blocked By: | Blocking: | ||
Branch state: | no branch | Votes for changeset: |
Description
Hi.
I've noted that mcedit doesn't capture the Alt-Ctrl-… key strokes. They are fully legal keys, being represented by the sequences: ESC(^[)-Ctrl(^)key, e.g.: ^[^g for Alt-Ctrl-g.
Could the support for the keys be added to the editor? They would greatly increase the available key-space, making it possible to create a more memorable mappings (like when e.g.: "oh no, ctrl-n, alt-n and alt-shift-n are all already taken, where will I map EditNewFile??", the answer: "to ctrl-alt-n" ;)).
Change History
comment:2 Changed 4 years ago by angel_il
my Xterm config:
xterm*decTerminalID: vt340 XTerm*foreground: green XTerm*cursorColor: darkgreen XTerm*background: black XTerm*scrollBar: False XTerm*saveLines: 1000 XTerm*metaSendsEscape: true XTerm*selectToClipboard: true XTerm.omitTranslation: fullscreen XTerm*font1: -xos4-terminus-medium-r-*-*-12-*-*-*-*-*-iso10646-1 XTerm*font2: -xos4-terminus-medium-r-*-*-14-*-*-*-*-*-iso10646-1 XTerm*font3: -xos4-terminus-medium-r-*-*-16-*-*-*-*-*-iso10646-1 XTerm*font4: -xos4-terminus-medium-r-*-*-20-*-*-*-*-*-iso10646-1 XTerm*font5: -xos4-terminus-medium-r-*-*-22-*-*-*-*-*-iso10646-1 XTerm*font6: -xos4-terminus-medium-r-*-*-28-*-*-*-*-*-iso10646-1 XTerm*font: -xos4-terminus-medium-r-*-*-22-*-*-*-*-*-iso10646-1 XTerm*VT100.Translations: #override \n\ Ctrl <Key>KP_Divide: string(0x1b) string("[7;OQ~") \n\ Ctrl <Key>KP_Multiply: string(0x1b) string("[7;OR~") \n\ Ctrl <Key>KP_Subtract: string(0x1b) string("[7;OS~") \n\ Ctrl <Key>KP_Add: string(0x1b) string("[7;Ol~") \n\ Shift Ctrl <Key>Tab: string(0x1b) string("[~Z") \n\ Ctrl <Key>Tab: string(0x1b) string("[z") \n\ Shift Ctrl <Key>Prior: string(0x1b) string("[5;6~") \n\ Shift <Key>Prior: string(0x1b) string("[5;2~") \n\ Shift Ctrl <Key>Next: string(0x1b) string("[6;6~") \n\ Shift <Key>Next: string(0x1b) string("[6;2~") \n\ Shift <Key>Insert: string(0x1b) string("[2;2~") \n\ <Btn1Down>: select-start(CLIPBOARD) \n\ <Btn1Up>: select-end(PRIMARY,CLIPBOARD,CUT_BUFFER0) \n\ Shift <Btn1Down>: ignore() \n\ Shift <Btn1Up>: select-end(PRIMARY,CLIPBOARD,CUT_BUFFER0) \n\ <Btn2Down>: select-start(CLIPBOARD) \n\ <Btn2Up>: select-end(PRIMARY,CLIPBOARD,CUT_BUFFER0) \n\ Shift <Btn2Down>: select-start(CLIPBOARD) \n\ Shift <Btn2Up>: select-end(PRIMARY,CLIPBOARD,CUT_BUFFER0) \n\ <Btn3Down>: ignore() \n\ <Btn3Up>: insert-selection(PRIMARY,CLIPBOARD) \n\ Shift <Btn3Down>: ignore() \n\ Shift <Btn3Up>: insert-selection(PRIMARY,CLIPBOARD) \n\ Meta <Key>F9: fullscreen()
comment:3 Changed 4 years ago by angel_il
my ini file (xterm section)
[terminal:xterm] ctrl-f9=\\e[20\;5 ctrl f1=\\e[11\;5 ctrl f2=\\e[12\;5 ctrl f3=\\e[13\;5 ctrl f4=\\e[14\;5 ctrl alt right=\\e\\e[C ctrl alt left=\\e\\e[D ctrl alt up=\\e\\e[A ctrl alt down=\\e\\e[B alt right=\\e\\eOC alt left=\\e\\eOD alt up=\\e\\eOA alt down=\\e\\eOB alt end=\\e\\e[4~ alt home=\\e\\e[1~ alt pgup=\\e\\e[5~ alt pgdn=\\e\\e[6~ ctrl right=\\e[C ctrl left=\\e[D ctrl up=\\e[A ctrl down=\\e[B ctrl home=\\e[1\;5H ctrl end=\\e[1\;5F ctrl pgup=\\e[[5\;5~ ctrl pgdn=\\e[[6\;5~ alt end=\\e\\e[4~ alt home=\\e\\e[1~ alt pgup=\\e\\e[5~ alt pgdn=\\e\\e[6~ alt f7=\\e\\e[18~ alt 1=\\e1 alt 2=\\e2 alt 3=\\e3 alt 4=\\e4 alt 5=\\e5 f16=\\e[29~ f17=\\e[18\;2~ f18=\\e[32~ f19=\\e[18\;3~ alt-f1=\\e[1\;3P complete=\\e[Z #backtab=\\e[Z alt shift right=\\e[1\;4C alt shift left=\\e[1\;4D ctrl-shift-left=\\e[[1\;6D ctrl-shift-right=\\e[1\;6C #ctrl-shift-home #ctrl-shift-end alt-f12=\\e[24\;3~ alt-f11=\\e[23\;3~ alt-f7=\\e[18\;3~ shift-delete=\\e[3\;2~ shift-tab=\\e[Z ctrl-backspace=^h ctrl-tab=\\e[z ctrl-shift-tab=\\e[~Z ctrl-shift-home=\\e[1\;6H ctrl-shift-end=\\e[1\;6F ctrl-kpasterisk=\\e[7\;OR~ ctrl-kpplus=\\e[7\;Ol~
comment:5 Changed 4 years ago by psprint
Thanks for sharing the method of overriding the keys meanings. I think that it'll be useful to me.
Surprisingly, the ctrl-alt-… bindings started to work on a new system. Apparently the ones that I've tried before were overlapping with the window manager's ones. So this issue is resolved now.
However, I still cannot map alt-space. I've tried overriding with the [terminal:xterm] section of the ini file, by entering e.g.:
[terminal:xterm] alt space =\\ex
Just as an experiment to see if pressing Alt-x will trigger alt-space bindings and it did not.
So it seems that overriding the binding's meaning is also blocked, not only binding it. Or maybe it's the binding that's blocked and that's why even the original, not-overridden key sequence (i.e.: ^[char(0x20)) doesn't work.
Also, why doesn't alt-space work? cat -v shows it produces the expected escape followed by a space, i.e. ^[char(0x20), so I think that it should be supported?