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

Keyboard handlers can't be overridden #226

Closed
philippfromme opened this issue Sep 4, 2017 · 4 comments
Closed

Keyboard handlers can't be overridden #226

philippfromme opened this issue Sep 4, 2017 · 4 comments
Assignees
Labels
enhancement New feature or request refactoring

Comments

@philippfromme
Copy link
Contributor

philippfromme commented Sep 4, 2017

Since there is no way of prioritizing keyboard handlers I can't override a handler that was previously registered.

Use case: I built a token simulation plugin for bpmn-js that allows me to switch to simulation mode where I can't model. I can't reuse the 'l' key for toggling the log because it has already been assigned to toggling the lasso tool.

@nikku
Copy link
Member

nikku commented Sep 4, 2017

Makes sense. What about implementing a mode-aware keyboard that re-uses the existing one or another one, based on the selected mode?

@philippfromme
Copy link
Contributor Author

+1

@nikku nikku added refactoring enhancement New feature or request backlog Queued in backlog labels Apr 9, 2018
@nikku
Copy link
Member

nikku commented Apr 9, 2018

We should add priorities (known from other event-based APIs in our system).

@ghost ghost assigned barmac Oct 19, 2018
@ghost ghost added in progress Currently worked on and removed backlog Queued in backlog labels Oct 19, 2018
barmac added a commit that referenced this issue Oct 22, 2018
* use KeyboardEvent.key value by default
* allow to register KeyboardEvent listeners for specified keys
* allow to use priority for KeyboardEvents
* default listeners will use key values instead of keyCode
* preserve previous way of registering listeners

There are three ways to register a listener now using keyboard.addListener:
1. Pass key or array of keys, then priority and the callback
2. Pass key or array of keys, then callback (default priority will be used)
3. Pass sole callback for global keyboard listener (lower priority than the latter)

Closes #226
barmac added a commit that referenced this issue Oct 22, 2018
* use KeyboardEvent.key by default as keyCode is deprecated
* allow to register KeyboardEvent listeners for specified keys
* allow to use priority for KeyboardEvents
* default listeners will use key values instead of keyCode
* preserve previous way of registering listeners

There are three ways to register a listener now using keyboard.addListener:
1. Pass key or array of keys, then priority and the callback
2. Pass key or array of keys, then callback (default priority will be used)
3. Pass sole callback for global keyboard listener (lower priority than the latter)

Closes #226
barmac added a commit that referenced this issue Oct 22, 2018
* use KeyboardEvent.key by default as keyCode is deprecated
* allow to register KeyboardEvent listeners for specified keys
* allow to use priority for KeyboardEvents
* default listeners will use key values instead of keyCode
* preserve previous way of registering listeners

There are three ways to register a listener now using keyboard.addListener:
1. Pass key or array of keys, then priority and the callback
2. Pass key or array of keys, then callback (default priority will be used)
3. Pass sole callback for global keyboard listener (lower priority than the latter)

Closes #226
barmac added a commit that referenced this issue Oct 23, 2018
* use KeyboardEvent.key by default as keyCode is deprecated
* allow to register KeyboardEvent listeners for specified keys
* allow to use priority for KeyboardEvents
* default listeners will use key values instead of keyCode
* preserve previous way of registering listeners

There are three ways to register a listener now using keyboard.addListener:
1. Pass key or array of keys, then priority and the callback
2. Pass key or array of keys, then callback (default priority will be used)
3. Pass sole callback for global keyboard listener (lower priority than the latter)

Closes #226
barmac added a commit that referenced this issue Oct 23, 2018
…-bus

* use KeyboardEvent.key for new listeners as keyCode is deprecated
* allow to register KeyboardEvent listeners for specified keys
* allow to use priority for KeyboardEvents
* default listeners will use key values instead of keyCode
* preserve previous way of registering listeners

There are three ways to register a listener now using keyboard.addListener:
1. Pass key or array of keys, then priority and the callback
2. Pass key or array of keys, then callback (default priority will be used)
3. Pass sole callback for global keyboard listener (lower priority than the latter)

Closes #226
barmac added a commit that referenced this issue Oct 23, 2018
* use KeyboardEvent.key for new listeners as keyCode is deprecated
* allow to register KeyboardEvent listeners for specified keys
* allow to use priority for KeyboardEvents
* default listeners will use key values instead of keyCode
* preserve previous way of registering listeners

There are three ways to register a listener now using keyboard.addListener:
1. Pass key or array of keys, then priority and the callback
2. Pass key or array of keys, then callback (default priority will be used)
3. Pass sole callback for global keyboard listener (lower priority than the latter)

Closes #226
barmac added a commit that referenced this issue Oct 24, 2018
BREAKING CHANGE: lifecycle listeners will no longer receive field listeners

* Listeners are no longer stored inside Keyboard.
* Field `listeners` was removed from lifecycle events.

Closes #226
barmac added a commit that referenced this issue Oct 24, 2018
BREAKING CHANGE: lifecycle listeners will no longer receive field listeners

* Listeners are no longer stored inside Keyboard.
* Field `listeners` was removed from lifecycle events.

Closes #226
barmac added a commit that referenced this issue Oct 25, 2018
BREAKING CHANGE: lifecycle listeners will no longer receive field listeners

* Listeners are no longer stored inside Keyboard.
* Field `listeners` was removed from lifecycle events.

Closes #226
merge-me bot pushed a commit that referenced this issue Oct 25, 2018
BREAKING CHANGE: lifecycle listeners will no longer receive field listeners

* Listeners are no longer stored inside Keyboard.
* Field `listeners` was removed from lifecycle events.

Closes #226
@nikku
Copy link
Member

nikku commented Oct 26, 2018

Closed via 4d72e38

@nikku nikku closed this as completed Oct 26, 2018
@ghost ghost removed the in progress Currently worked on label Oct 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request refactoring
Projects
None yet
Development

No branches or pull requests

3 participants