Skip to main content

Profile

Struct Profile 

pub struct Profile {
    pub timeout: Option<u16>,
    pub interrupt_response: InterruptResponse,
    pub required_idle_time: Option<u16>,
    pub hold_trigger_positions: Option<Slice<u16, smart_keymap_core::::key::tap_hold::Profile::{constant#0}>>,
    pub quick_tap_ms: Option<u16>,
    pub pending_output: PendingOutput,
}
Expand description

One tap-hold behavior profile (timeout, interrupt flavor, idle gate, hold triggers, quick-tap).

Profile 0 is Config::default_profile; extra profiles live in Config::profiles and are selected per key via Key::profile.

Fields§

§timeout: Option<u16>

The timeout (in number of milliseconds) for a tap-hold key to resolve as hold.

Counted from the physical press of this keymap index. When this tap-hold is nested under another pending key (e.g. chorded passthrough), the keymap folds already-elapsed time into the scheduled delay so the configured timeout is not additive.

When None, the tap/hold decision does not timeout; the key resolves only on release (as tap) or interruption (depending on InterruptResponse).

§interrupt_response: InterruptResponse

How the tap-hold key should respond to interruptions.

§required_idle_time: Option<u16>

Amount of time (in milliseconds) the keymap must have been idle in order for tap hold to support ‘hold’ functionality.

This reduces disruption from unexpected hold resolutions when typing quickly.

§hold_trigger_positions: Option<Slice<u16, smart_keymap_core::::key::tap_hold::Profile::{constant#0}>>

When set, only these keymap indices may force an interrupt-as-hold resolution. When unset, any interrupting key may force hold (subject to InterruptResponse).

JSON field name matches the Nickel authoring surface (hold_trigger_key_positions). Length is bounded by MAX_HOLD_TRIGGER_POSITIONS.

§quick_tap_ms: Option<u16>

If this tap-hold key is pressed again within this many milliseconds of its previous press (ZMK quick-tap-ms), immediately resolve as tap.

Useful for hold-to-repeat on the tap letter (e.g. backspace) without waiting for the hold timeout. None disables (default).

Unlike Self::required_idle_time (any recent activity), this is scoped to re-presses of the same keymap index.

§pending_output: PendingOutput

Speculative HID while this tap-hold is pending.

  • PendingOutput::NoOutput (default): no HID until tap vs hold settles.
  • PendingOutput::Hold: emit the hold binding’s HID while still pending (ZMK hold-while-undecided / QMK Speculative Hold / FAK eager_decision = 'hold).

Implementations§

§

impl Profile

pub const fn new() -> Profile

Constructs a new default Profile.

pub const fn allows_hold_trigger(&self, other_keymap_index: u16) -> bool

Whether an interrupt from other_keymap_index may force hold.

When Self::hold_trigger_positions is set, only those indices count as hold triggers. When unset, any other key may force hold.

Trait Implementations§

§

impl Clone for Profile

§

fn clone(&self) -> Profile

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
§

impl Copy for Profile

§

impl Debug for Profile

§

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

Formats the value using the given formatter. Read more
§

impl Default for Profile

§

fn default() -> Profile

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

impl<'de> Deserialize<'de> for Profile

§

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

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

impl PartialEq for Profile

§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

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

impl StructuralPartialEq for Profile

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

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

Source§

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
Source§

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

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

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

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

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

Performs the conversion.
Source§

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

Source§

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

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

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

Performs the conversion.