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 KeystrokeHandler#unset #4957

Closed
ma2ciek opened this issue May 25, 2017 · 3 comments
Closed

Implement KeystrokeHandler#unset #4957

ma2ciek opened this issue May 25, 2017 · 3 comments
Labels
package:utils resolution:expired This issue was closed due to lack of feedback. status:discussion status:stale type:feature This issue reports a feature request (an idea for a new functionality or a missing option).

Comments

@ma2ciek
Copy link
Contributor

ma2ciek commented May 25, 2017

There's no option for now to unset the listener from the KeystrokeHandler despite the destroy() method. This method would be useful when there's a need to destroy some plugin during the edition.


If you'd like to see this feature implemented, add 👍 to this post.

@Reinmar
Copy link
Member

Reinmar commented May 25, 2017

This would not be a safe solution. Imagine that in every plugin you'd need to remember to unset keystrokes on Plugin#destroy().

There's been that second topic consisting of https://github.com/ckeditor/ckeditor5-core/issues/20 and #340 in which it was proposed to use events instead of set/remove() approach. I don't fully recall now, but I later came to the same conclusions during some other task.

So, that would also be a solution to this problem. You'd use the keystroke handler like this in your plugin:

this.listenTo( this.editor.keystrokes, 'Alt+Enter', () => ... )

However, I don't see yet what would be the responsibility of the KeystrokeHandler in this yet. It seems that it'd become a class which:

  • can be plugged to listen to some key events (we use it now to listen on the editable or other parts of the UI – so we use multiple keystroke handlers),
  • translates key codes to human-readable events (like Alt+Enter),
  • provides useful API to handle the key press (but I don't think there's any specific need here).

Not sure, though, if going into events won't make it less useful.

@mlewand mlewand transferred this issue from ckeditor/ckeditor5-utils Oct 9, 2019
@mlewand mlewand added this to the backlog milestone Oct 9, 2019
@mlewand mlewand added status:discussion type:feature This issue reports a feature request (an idea for a new functionality or a missing option). package:utils labels Oct 9, 2019
@pomek pomek removed this from the backlog milestone Feb 21, 2022
@CKEditorBot
Copy link
Collaborator

There has been no activity on this issue for the past year. We've marked it as stale and will close it in 30 days. We understand it may be relevant, so if you're interested in the solution, leave a comment or reaction under this issue.

@CKEditorBot
Copy link
Collaborator

We've closed your issue due to inactivity over the last year. We understand that the issue may still be relevant. If so, feel free to open a new one (and link this issue to it).

@CKEditorBot CKEditorBot added the resolution:expired This issue was closed due to lack of feedback. label Nov 3, 2023
@CKEditorBot CKEditorBot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:utils resolution:expired This issue was closed due to lack of feedback. status:discussion status:stale type:feature This issue reports a feature request (an idea for a new functionality or a missing option).
Projects
None yet
Development

No branches or pull requests

5 participants