MCPcopy Create free account
hub / github.com/TyberiusPrime/KeyToKey / new

Method new

src/handlers/spacecadet.rs:46–59  ·  view source on GitHub ↗
(
        trigger: impl AcceptsKeycode,
        action: MAction,
        onoff: MOnOff,
    )

Source from the content-addressed store, hash-verified

44}
45impl<MAction: Action, MOnOff: OnOff> SpaceCadet<MAction, MOnOff> {
46 pub fn new(
47 trigger: impl AcceptsKeycode,
48 action: MAction,
49 onoff: MOnOff,
50 ) -> SpaceCadet<MAction, MOnOff> {
51 SpaceCadet {
52 trigger: trigger.to_u32(),
53 action,
54 onoff,
55 press_number: 0, //what was the running id of this?
56 state: SpaceCadetState::Base,
57 minimum_depress_ms: 100,
58 }
59 }
60}
61impl<T: USBKeyOut, MAction: Action, MOnOff: OnOff> ProcessKeys<T> for SpaceCadet<MAction, MOnOff> {
62 fn process_keys(&mut self, events: &mut Vec<(Event, EventStatus)>, output: &mut T) ->HandlerResult {

Callers

nothing calls this directly

Calls 1

to_u32Method · 0.80

Tested by

no test coverage detected