Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement "modifyOtherKeys" #3101

Closed
dnkl opened this issue Dec 14, 2019 · 4 comments
Closed

Implement "modifyOtherKeys" #3101

dnkl opened this issue Dec 14, 2019 · 4 comments

Comments

@dnkl
Copy link
Contributor

dnkl commented Dec 14, 2019

In short, enabling modifyOtherKeys lets the client recognize e.g. Ctrl-.; i.e. to see modifiers for keys where modifiers are normally ignored.

Note that in XTerm, the user can also enable this by default via XResources.

The enabling/disabling sequence is:

CSI > Pp m
          Set/reset key modifier options, xterm.  Set or reset resource-
          values used by xterm to decide whether to construct escape
          sequences holding information about the modifiers pressed with
          a given key.

          The first parameter Pp identifies the resource to set/reset.
          The second parameter Pv is the value to assign to the
          resource.

          If the second parameter is omitted, the resource is reset to
          its initial value.  Values 3  and 5  are reserved for keypad-
          keys and string-keys.

            Pp = 0  ⇒  modifyKeyboard.
            Pp = 1  ⇒  modifyCursorKeys.
            Pp = 2  ⇒  modifyFunctionKeys.
            Pp = 4  ⇒  modifyOtherKeys.

          If no parameters are given, all resources are reset to their
          initial values.

The values that can be "assigned" for modiyOtherKeys are:

modifyOtherKeys (class ModifyOtherKeys)
               Like modifyCursorKeys, tells xterm to construct an escape
               sequence for ordinary (i.e., "other") keys (such as "2") when
               modified by Shift-, Control-, Alt- or Meta-modifiers.  This
               feature does not apply to special keys, i.e., cursor-, keypad-,
               function- or control-keys which are labeled on your keyboard.
               Those have key symbols which XKB identifies uniquely.

               For example, this feature does not apply to special control-
               keys (e.g., Escape, Tab, Enter, Backspace) Other control keys
               (e.g., Control-I, Control-M, Control-H) may send escape
               sequences when this feature is enabled.

               The default is "0":

               0    disables this feature.

               1    enables this feature for keys except for those with well-
                    known behavior, e.g., Tab, Backarrow and some special
                    control character cases which are built into the X11
                    library, e.g., Control-Space to make a NUL, or Control-3
                    to make an Escape character.

                    Except for those special cases built into the X11 library,
                    the Shift- and Control- modifiers are treated normally.
                    The Alt- and Meta- modifiers do not cause xterm to send
                    escape sequences.  Those modifier keys are interpreted
                    according to other resources, e.g., the metaSendsEscape
                    resource.

               2    enables this feature for keys including the exceptions
                    listed.  Xterm ignores the special cases built into the
                    X11 library.  Any shifted (modified) ordinary key sends an
                    escape sequence.  The Alt- and Meta- modifiers cause xterm
                    to send escape sequences.

               The Xterm FAQ has an extended discussion of this feature, with
               examples:
               https://invisible-island.net/xterm/modified-keys.html

Broken out from #3091 (comment), and #2688 (comment)
@AmaiKinono

@chrisduerr
Copy link
Member

Thanks for creating a separate issue for easier tracking.

Note that in XTerm, the user can also enable this by default via XResources.

I think we should be good with skipping this. If there's an escape to set/unset it, I feel like we should be good without a dedicated config option.

@Patryk27
Copy link

fyi, I'm starting to implement this feature 🙂

@kchibisov
Copy link
Member

Given that kitty's protocol is quite common these days I don't think that adding modifyOtherKeys will provide a value other than maintainance burden.

Is this xterm poorly documented option is really required if alacritty will have full kitty protocol support?

@pataquets
Copy link
Contributor

Issue gardening:
#7125 has been merged, which I guess makes this issue obsolete.
/cc @dnkl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

5 participants