ember-keyboard
Advanced tools
Changelog
v6.0.2 (2020-10-30)
Changelog
v6.0.1 (2020-09-07)
Changelog
v6.0.0 (2020-06-10)
This major release sports new Octane-friendly API. You can see examples and read about the reasons for the API choices in our API Design doc.
Changelog
Upgrading from ember-keyboard 6.0.0-beta.1 to 6.0.0
The only changes since 6.0.0-beta.1 were internal dependency updates. Upgrading should be smooth.
Changelog
Upgrading from ember-keyboard 6.0.0-beta.0 to 6.0.0
The keyboard-press
component has been deprecated and replaced with the on-key
helper. The on-keyboard
and keyboard-shortut
modifiers have been deprecated and replaced with the on-key
modifier. The deprecations page has more info, along with the 5 to 6 upgrade guide immediately below.
Changelog
Upgrading from ember-keyboard 5.0.0 to 6.0.0
ember-keyboard 6.0.0-beta.1 introduces new APIs to bring ember-keyboard into the Ember Octane era. The old mixins-based API still works but is deprecated in this release and slated for removal in version 7.
Version 6 requires Ember 3.8 or higher, so if you are on a version of Ember before that, you should stick with 5.0.0 until you are able to upgrade your app's Ember version.
If your app is on a recent version of Ember, you are good to go. The path is to upgrade to ember-keyboard 6.x and you can iteratively update to the new APIs until you have no more deprecation warnings left.
The deprecations page discusses migration paths for each warning you may encounter, but our broader advice is to consider moving as much of your keyboard handling logic to templates as possible. We think that you'll find the on-key
helper and modifier to be very convenient to work with. The decorator API (which required ember 3.10 or higher) is closest equivalent to the mixins API, but it should be used sparingly in situations where the template approach isn't a good fit.
There is one other potential breaking change to be aware of when upgrading from v5 to v6: ember-keyboard versions before 6.0 had an ambiguous API when it came to specifying key combos and required the use of code
identifiers, like KeyT
, Digit1
, etc. Be sure to read the docs regarding key
vs. code
properties and be sure you are specifying the key combo consistent with your intended behavior. You will likely find that you want to update some key combos to the key
equivalent. e.g. replace ctrl+KeyT
with ctrl+t
.
Changelog
v4.0.0 (2018-09-05)
Big thanks to @NullVoxPopuli for this PR. Now, ember-keyboard
will respond to the key mapping, rather than the key itself. For instance, with a Dvorak key mapping, pressing 'k' will give a code of 'KeyV' and a key of 'k'. Now, ember-keyboard
will treat a Dvorak 'KeyV' as a 'k'.
This may introduce a regression if you intended to map to the key themselves, rather than to their code. If that's the case, please take out an issue and we'll figure out a way to support that behavior as well.
Changelog
v3.0.0 (2018-01-16)
This release has two potential breaking changes:
jQuery
's been removed! This means that responders will now receive vanilla events, instead of jQuery events. For instance, using jQuery's isImmediatePropagationStopped
will no longer work:responder: Ember.on(keyDown('KeyA'), function(event) {
event.isImmediatePropagationStopped();
})
config/environment.js
file:emberKeyboard: {
listeners: ['keyUp', 'keyDown', 'keyPress', 'click', 'mouseDown', 'mouseUp', 'touchStart', 'touchEnd']
}
...