A sequence is a series of keystrokes (press and release) that upon finish (ie. the release of the last key) sends first a (configurable) number of backspaces (to undo the input) and then an action. sequence keys - even if matching are not handled by Sequence, except if they're from the private range, in which case the Sequence will consume the Events. It is suggested to prefix your sequences wit
| 23 | /// triggers the prefix sequence, eating the keypress event, |
| 24 | /// and the second time the longer sequence sees it and advances. |
| 25 | pub struct Sequence<'a, M> { |
| 26 | sequence: &'a [u32], |
| 27 | callback: M, |
| 28 | backspaces: u8, |
| 29 | pos: u8, |
| 30 | } |
| 31 | |
| 32 | impl<'a, M: Action> Sequence<'a, M> { |
| 33 | pub fn new(sequence: &'a [u32], callback: M, backspaces: u8) -> Sequence<'a, M> { |
nothing calls this directly
no outgoing calls
no test coverage detected