Skip to content

Commit

Permalink
CHANGELOG and more doc for custom actionmagnet:?xt=urn:btih:a6721ad2e…
Browse files Browse the repository at this point in the history
…6a3aadba5caf0474998e1c2eb69af11&dn=Les.Blagues.De.Toto.2020.FRENCH.1080p.WEB.x264-PREUMS.mkv&tr=udp://tracker.openbittorrent.com:80&tr=udp://tracker.opentrackr.org:1337/announce
  • Loading branch information
TeXitoi committed Dec 12, 2020
1 parent 5929167 commit 0660d2b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ Breaking changes:
* `Action::HoldTap` now takes a configuration for different behaviors.
* `Action::HoldTap` now takes the `tap_hold_interval` field. Not
implemented yet.
* `Action` is now generic, for the `Action::Custom(T)` variant,
allowing custom action to be handled outside of keyberon. This
functionality can be used to drive non keyboard actions, as reset
the microcontroller, drive leds (for backlight or underglow for
example), manage a mouse emulation, or any other ideas you can
have. As there is a default value for the type parameter, the update
should be transparent.

# v0.1.1

Expand Down
5 changes: 5 additions & 0 deletions src/action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ where
tap_hold_interval: u16,
},
/// Custom action.
///
/// Define a user defined action. This enum can be anything you
/// want, as long as it has the `'static` lifetime. It can be used
/// to drive any non keyboard related actions that you might
/// manage with key events.
Custom(T),
}
impl<T> Action<T> {
Expand Down
3 changes: 2 additions & 1 deletion src/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,8 @@ impl<T: 'static> Layout<T> {
///
/// This method must be called regularly, typically every millisecond.
///
/// Returns an iterator on the current key code state.
/// Returns the corresponding `CustomEvent`, allowing to manage
/// custom actions thanks to the `Action::Custom` variant.
pub fn tick<'a>(&'a mut self) -> CustomEvent<T> {
self.states = self.states.iter().filter_map(State::tick).collect();
self.stacked.iter_mut().for_each(Stacked::tick);
Expand Down

2 comments on commit 0660d2b

@riskable
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... Can someone provide the English translation of Les.Blagues.De.Toto.2020.FRENCH.1080p.WEB.x264-PREUMS.mkv? 😄

You might want to fix the commit message hehe

@TeXitoi
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

amended, thanks

Please sign in to comment.