[External] : Re: Key binding customization proposal

Michael Strauß michaelstrau2 at gmail.com
Wed Nov 8 19:24:02 UTC 2023


Hi Andy!

> There is a number of use cases for runtime modifications:
>
> - there might be a requirement to switch between vim/emacs/etc. key mapping
> - there might be a requirement to customize the mapping per user configuration (see the Eclipse “Keys” UI that I’ve shown before)
> - there are many apps (AquaFold Data Studio, for one I remember) which allows for customization of key bindings

Maybe we should pull on this string a little bit more. It's still not
clear to me what the requirements actually are. What is meant by
"switch between vim/emacs/etc. key mappings"? Maybe you can give a
specific example.

1. The way I understand it, the only thing a public InputMap API would
enable developers to do would be to change key mappings of existing
control functionality. For example, I could re-map the left arrow to
invoke the "moveRight" function, or I could re-map ctrl+A to "copy"
text, instead of "select all" text. But why would I want to do that?
These are default mappings for a reason. Is there any example in which
such a re-mapping would potentially be useful?

2. We seem to be talking about text a lot. Is there any specific
example beyond TextInputControl that would benefit from this feature?
Maybe this should be an extension for TIC, and not for the control
architecture as a whole?

3. I have two examples that are not possible in JavaFX right now (at
last not out of the box):

- In IntelliJ, there's an option that toggles the way I can scroll
through text on a word-by-word basis (look for: "Use CamelHump
words"). If toggled, I can ctrl-arrow left or right, and the caret
will be placed either at the beginning of the next or previous word
boundary, or alternatively at the beginning of the next or previous
case change within a word (the "CamelHump").

- Also in IntelliJ, there's an option for "Home moves caret to first
non-whitespace character". The alterative is that Home moves the caret
to the beginning of the line.

The proposed API doesn't enable me to implement those features, does
it? This leads me to think that what we really need is a way to
customize the "behavior" (whatever this ends up being) of a control
more so than its default key mappings.


More information about the openjfx-dev mailing list