Releases: rhysd/keybinds-rs
Releases · rhysd/keybinds-rs
v0.2.0
v0.1.1
v0.1.0
The first stable release 🎉
- BREAKING: Remove
Key::Backtab
because it is actually not mapped to a single key. crossterm'sBackTab
key is now correctly mapped to Shift + Tab. - Define the minimum supported Rust version is 1.80.0.
- Clarify the versioning of this crate in documents.
- Add the contribution guide.
- Add the
vim
example to demonstrate how to use this crate for modal key bindings. - Add
Keybinds::ongoing_inputs
to get the key inputs matching to some key bindings. - Add
Key::Help
variant. - Fix parsing
NumLock
key.
v0.0.9
- BREAKING: Merge
KeybindDispatcher
intoKeybinds
. NowKeybinds
directly hasdispatch
method and dispatches actions. This change makes the API simpler. Note that setting different timeout values to compared objects makes==
operator returnfalse
even if the key bindings are completely equal. - BREAKING: Rewrite
KeySeq
using smallvec. Now it is a struct instead of enum and it no longer allows accessing the internal state.- Key sequences containing up to 2 key inputs can be allocated on stack instead of heap (previously only a single key input could be allocated on stack).
KeySeq
now implementsHash
trait.- Methods for adding inputs to a key sequence were implemented.
- BREAKING: Replace
Key::F(u8)
variant withKey::F1
...Key::F35
variants. This change brings the following benefits.- The size of
Key
was reduced from 8 bytes to 4 bytes becauseu8
value required a 3 bytes padding. - Invalid keys such as
Key::F(0)
orKey::F(99)
are now not possible.
- The size of
- Implement
Extend
forKeybinds
to append multiple key bindings. - Fix crossterm's button release event is not ignored as
Key::Ignored
. - Fix an empty key sequence does not cause an error on serialization.
- Explain the crate features in Cargo.toml.
v0.0.8
- BREAKING:
KeyInput::new
now takesInto<Mods>
instead ofMods
. - BREAKING: Implement
FromIterator<Keybind>
forKeybinds
instead ofKeybindDispatcher
. - Add API documents to all the APIs. Read it on docs.rs.
- Add
KeybindDispatcher::into_keybinds
. - Add
Keybinds::take_dispatcher
method. - Add the support for F21~F35 keys by iced and winit.
v0.0.7
- Support iced as optional
iced
feature. (example) - Fix Shift modifier is not converted correctly from platform-specific events.
- Fix Meta modifier key is wrongly handled as Cmd key on converting crossterm events.
- Scrape examples on generating API documents for docs.rs.
- Add the fuzz tests.
- Refine the crossterm example with more practical usage.
v0.0.6
- Support serializing key bindings with serde crate.
serde
feature needs to be enabled. (example) - Support structural fuzzing with arbitrary crate.
arbitrary
feature needs to be enabled. (example) - Implement
Display
trait forKey
,Mod
,KeyInput
, andKeySeq
. - Improve an error message on Shift modifier with unnamed keys.
v0.0.5
- BREAKING: Make some
new
constructor functions intoFrom::from
trait implementations with more generic arguments usingInto
trait. - BREAKING: Avoid heap allocation on a single-key key binding by changing
KeySeq
struct to an enum. - BREAKING: Rename
KeySeq::matches
toKeySeq::match_to
. - BREAKING: Hide
KeyInput
's fields and add getter methodsKeyInput::key
,KeyInput::mods
. - Add support for
Shift
modifier again.Shift
modifier key is only available with named keys likeShift+Up
. For example, when you want to define key binding for Shift + A, you need to useA
instead ofShift+a
. This restriction is for avoiding some confusing edge cases and may be relaxed in the future. - Make fields of
Keybind
struct public. - Fix error handling on parsing invalid empty key bindings.
- Fix non-ASCII spaces like
U+3000
are not available for key binding. - Define the key binding syntax in the separate document.
v0.0.4
- BREAKING: Use logical keys instead of physical keys. Now the characters in key sequence are case-sensitive. For example, logical key
A
means typing "A" and "Shift" physical keys and it is distinguished froma
(only typing "A"). Along with this change,Shift
modifier key was removed. - BREAKING: Rename
KeybindDispatcher::trigger
toKeybindDispatcher::dispatch
. - Implement
FromIterator<Keybind<A>>
forKeybindDispatcher<A>
to constructor a dispatcher instance from a list of key bindings easily. - Implement
Deref<Target=[KeyBind]>
forKeybinds
and implementKeybindDispatcher::keybinds
getter method. - Add API document for all optional features.
- Add
minimal
andserde
examples.
v0.0.3: rename key bindings API
- BREAKING: Key bindings API was renamed.
KeyBindMatcher
→KeybindDispatcher
KeyBinds
→Keybinds
KeyBind
→Keybind
- BREAKING: Some methods were renamed.
KeybindDispatcher::timeout
→KeybindDispatcher::set_timeout
- Support termwiz as optional
termwiz
feature. - Allow modifiers in upper case like
CTRL
. - Implement
KeybindDispatcher::bind
andKeybindDispatcher::add
methods for easily defining key bindings.