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

Suggestion: add interface to allow specifying action for a key event #16

Closed
NSoiffer opened this issue Sep 5, 2017 · 1 comment
Closed
Assignees

Comments

@NSoiffer
Copy link
Collaborator

NSoiffer commented Sep 5, 2017

Description

I'd like to capture some key events and do some action with them. E.g., I'd like to capture shift-delete/backspace and bind those keys to an action that will cross out the item that would have been deleted. Ideally, I'd like the scheme to support multiple keystrokes, but potentially that is something that is handled by the callback (i.e, the callback records state).

Currently, there is no public interface to do this. However, there is a private interface in editor/keyboard that includes:

delegateKeyboardEvents(textarea: Element, handlers: Object)

Exposing something like this would like let me do what I want, at least for single key events.

Control of passing on the event to let another handler take it should probably be left up to the handler, but that needs to be thought about and maybe the answer is dependent upon the specific key event.

@arnog arnog self-assigned this Sep 14, 2017
@arnog
Copy link
Owner

arnog commented Sep 14, 2017

Done. Added onKeystroke handler to config of MathField.

@arnog arnog closed this as completed Sep 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants