use postcard::experimental::max_size::MaxSize;
use serde::{Deserialize, Serialize};
use super::KeyAction;
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize, MaxSize)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[cfg_attr(feature = "wasm", derive(tsify::Tsify))]
#[cfg_attr(feature = "wasm", tsify(into_wasm_abi, from_wasm_abi))]
pub struct EncoderAction {
pub clockwise: KeyAction,
pub counter_clockwise: KeyAction,
}
impl Default for EncoderAction {
fn default() -> Self {
Self {
clockwise: KeyAction::No,
counter_clockwise: KeyAction::No,
}
}
}
impl EncoderAction {
pub const fn new(clockwise: KeyAction, counter_clockwise: KeyAction) -> Self {
Self {
clockwise,
counter_clockwise,
}
}
}