Support for setting extensible keystrokes (e.g. enter) through the keystroke handler #2853
Labels
package:core
resolution:expired
This issue was closed due to lack of feedback.
status:stale
type:feature
This issue reports a feature request (an idea for a new functionality or a missing option).
type:question
This issue asks a question (how to...).
Currently handlers for (Shift+)Enter and (Shift+)Tab are defined directly on the editing view, so there's no way to redefine what keystrokes cause them. Actually, there is but it requires registering a handler (using
editor.keystrokes.add()
) which fires a properkeydown
event on the editing view.It's also unclear, which keystrokes have to be defined on the editing view and which through a keystroke handler.
So far, that would be easy to solve, however, as we agreed after a very long discussion, the list feature will listen on
enter
event on the editing view in order to tweak the default behaviour. Some features will be extending the enter command itself, but when the semantics changes, then we should handle it on the view.However, this means that if we configure keystroke handler to execute
enter
command on Enter, the list feature will still need to modify this behaviour on the editing view level. So when someone decides to say that now Foo should behave like Enter and sets that through a keystroke handler, only the behaviour of theenter
command will be used. The behaviour of the list feature will be ignored.The only reasonable option that I see is:
EnterObserver
from the editing view.(???+)Enter
(1) theenter
command is executed.enter
command's behaviour (can you think of any cons of this, @scofalik?).Ad (1) Currently we'd like to handle enter with all modifiers, so either we'll add keystrokes for all combinations (sad) or we'll add a notation for optional modifiers. Like
[Ctrl]+[Alt]+[Shift]+Enter
.Now, you'll always be able to redefine which keystrokes trigger
enter
command and we won't need some magic in the keystroke handler (which seems to be the only alternative if we don't want to change 2.).Finally, I feel that even keystrokes like Backspace should be defined using the keystroke handler. What I wrote above is very similar to how it works in CKE4 with this difference, that in CKE4 some features like list or tables were listening directly on the editable's events (our editing view):
I think that we must avoid this. It's never been a big problem (although I recall that widgets had to deal with this), but just for the sake of being able to answer people's question – how should I handle xyz (that's how @scofalik provoked this ticket :D).
The text was updated successfully, but these errors were encountered: