MorseProfile

Struct MorseProfile 

Source
pub struct MorseProfile(/* private fields */);
Expand description

Configuration for morse, tap dance and tap-hold to save some RAM space, manually packed into 32 bits

Implementations§

Source§

impl MorseProfile

Source

pub const fn const_default() -> Self

Source

pub fn unilateral_tap(self) -> Option<bool>

If the previous key is on the same “hand”, the current key will be determined as a tap

Source

pub const fn with_unilateral_tap(self, b: Option<bool>) -> Self

Source

pub fn mode(self) -> Option<MorseMode>

The decision mode of the morse/tap-hold key

  • If neither of them is set, the decision is made when timeout
  • If permissive_hold is set, same as QMK’s permissive hold: When another key is pressed and released while the current morse key is held, the hold action of current morse key will be triggered https://docs.qmk.fm/tap_hold#tap-or-hold-decision-modes
  • if hold_on_other_press is set - triggers hold immediately if any other non-morse key is pressed while the current morse key is held
Source

pub const fn with_mode(self, m: Option<MorseMode>) -> Self

Source

pub fn hold_timeout_ms(self) -> Option<u16>

If the key is pressed longer than this, it is accepted as hold (in milliseconds) if given, should not be zero

Source

pub const fn with_hold_timeout_ms(self, t: Option<u16>) -> Self

Source

pub const fn set_hold_timeout_ms(&mut self, t: u16)

Source

pub const fn set_gap_timeout_ms(&mut self, t: u16)

Source

pub fn gap_timeout_ms(self) -> Option<u16>

The time elapsed from the last release of a key is longer than this, it will break the morse pattern (in milliseconds) if given, should not be zero

Source

pub const fn with_gap_timeout_ms(self, t: Option<u16>) -> Self

Source

pub const fn new( unilateral_tap: Option<bool>, mode: Option<MorseMode>, hold_timeout_ms: Option<u16>, gap_timeout_ms: Option<u16>, ) -> Self

Trait Implementations§

Source§

impl Clone for MorseProfile

Source§

fn clone(&self) -> MorseProfile

Returns a duplicate of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MorseProfile

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for MorseProfile

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for MorseProfile

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl From<MorseProfile> for u32

Source§

fn from(val: MorseProfile) -> Self

Converts to this type from the input type.
Source§

impl From<u32> for MorseProfile

Source§

fn from(v: u32) -> Self

Converts to this type from the input type.
Source§

impl MaxSize for MorseProfile

Source§

const POSTCARD_MAX_SIZE: usize = 5usize

The maximum possible size that the serialization of this type can have, in bytes.
Source§

impl PartialEq for MorseProfile

Source§

fn eq(&self, other: &MorseProfile) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for MorseProfile

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Copy for MorseProfile

Source§

impl Eq for MorseProfile

Source§

impl StructuralPartialEq for MorseProfile

Auto Trait Implementations§

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CloneToUninit for T
where T: Clone,

§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,