#16 Support "modifyOtherKeys" mode

closed
nobody
None
5
2012-08-21
2012-06-15
No

This mode of xterm and mintty supports enhanced application control over modified keys (not function keys).

Control sequences to terminal:
ESC[>4;2m enable "modifyOtherKeys" mode
ESC[>4m reset "modifyOtherKeys" mode
(optional: ESC[>4;0m disable "modifyOtherKeys" mode)

Control sequences sent from terminal if a "normal" (non-function) key is combined with modifiers:
ESC[<unicode>;<mod>u
where
<unicode> is the decimal Unicode value (considering Shift state)
<mod> is the usual modifier code (5=ctrl, 6=ctrl-shift, 7=ctrl-alt, 8=ctrl-alt-shift)

Encoding shift is optional (xterm does it, mintty does not).

Examples:
Control-, ESC[44;5u
Alt-Control-1 ESC[49;7u
Control-a ESC[97;5u (optional, ^A would be fine here)
Control-Shift-A ESC[65;6u

A use case is input support for accented characters as provided by the Unicode editor mined:
Control-, c will enter ç etc.
This would be good to support especially in a dedicated multi-lingual terminal.

Discussion

  • Araki Ken

    Araki Ken - 2012-06-24

    I supported CSI [>4;2m and CSI [>4;0m.
    Please test the attached patch or hg head.

     
  • Thomas Wolff

    Thomas Wolff - 2012-06-25

    Great, thanks for the quick response. My first observations:

    * After starting mlterm, the mode was switched on initially. Probably not appropriate for many people.
    Also switching off does not work with either of the sequences ESC[>4;0m or ESC[>4m - where the latter would be preferred so an application can reset the mode in a portable way.

    * Combinations with Alt (where Alt is reported):
    Ctrl-1 is OK, modifier 5
    Alt-1 is OK, modifier 3
    Ctrl-Alt-1 should indicate both, modifier 7, but now sends 3 as well

    * Combination with Alt (where Alt alone is not reported in this mode):
    Ctrl-, is OK
    Alt-, is ESC , (fine with that)
    Ctrl-Alt-, again, is just like Alt-,, should be indicated combined

    * Shift:
    I was not precise when I said "Encoding shift is optional"; I meant only for those characters that have a shifted character code (like "A").
    Control-Shift-, should send the modified version (according to this mode) of the character delivered by Shift-, (on German keyboard: ';', so the Control-encoded sequence of ';' should be sent.

    Will check any update, thanks.

     
  • Araki Ken

    Araki Ken - 2012-06-29

    Thanks.
    I couldn't reproduce most of these problems in my Cygwin/X.

    Will you test http://mlterm.sf.net/mlterm-3.1.3pre-20120626.tar.gz
    instead of the previous patch ?
    mlterm-3.1.3pre-20120626.tar.gz contains the previous patch and
    an following additional change.

    (change)
    modifyOtherKeys flag is kept by each pty, not by each window.

     
  • Thomas Wolff

    Thomas Wolff - 2012-07-02

    Not seeing an updated patch here.

     
  • Araki Ken

    Araki Ken - 2012-08-11

    Sorry for my delayed response.

    Doesn't mlterm-3.1.3 remedy this problem ?

     
  • Thomas Wolff

    Thomas Wolff - 2012-08-14

    Everything works fine now, with one exception:

    In the SunOS-compiled version, initially (without having switched the mode on), Control-, sends ^[[27;5;44~ (not ^[[27;5;44u like with the mode switched on, and not just , as expected).
    (likewise other modified punctuation keys but not letters etc).

    This does not happen with the Cygwin-compiled version which is perfect now.
    Cannot test on Linux at this time.

     
  • Thomas Wolff

    Thomas Wolff - 2012-08-14

    Typo in last comment: Control-, sends ^[[27;5;44~ (not ^[[44;5u like with the mode
    switched on, and not just , as expected).

     
  • Araki Ken

    Araki Ken - 2012-08-20

    Thanks.

    I'm confused, because mlterm doesn't support ^[[27;<mod>;<code>~ format for modifyOtherKeys.
    Does following steps show ^[[27;5;44~ ?

    $ cat
    [Enter Control-,]
    ^[[27;5;44~

     
  • Thomas Wolff

    Thomas Wolff - 2012-08-20

    Good reason to be confused - this was a bogus effect due to my own configuration
    in .mlterm/key which I had once patched for testing and then forgotten.
    Sorry for this - everything is OK now.

     
  • Araki Ken

    Araki Ken - 2012-08-21
    • status: open --> closed
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks