[−][src]Struct keytokey::handlers::Layer
A layer either rewrites a key to another one or outputs a string upon key release.
It does this for multiple mappings at once, and it can consider the shift state, which is very useful for unicode characters with lower and upper case.
Unfortunatly, Layers are memory inefficient, they keep their mapping in ram, and each mapping is at least 96 bits / 12 bytes.
Consider using a RewriteLayer instead if you don't need the string, Shift or Action functionality.
If AutoOff is set to anything but AutoOff::No, the layer will turn itself of after any key release (AutoOff::AfterAll), after a non-modifier-non-oneshot key release (AutoOff::AfterNonModifier), or after a successfull match AutoOff::AfterMatch
Implementations
impl<'_> Layer<'_>
[src]
pub fn new<F: AcceptsKeycode>(
rewrites: Vec<(F, LayerAction)>,
auto_off: AutoOff
) -> Layer
[src]
rewrites: Vec<(F, LayerAction)>,
auto_off: AutoOff
) -> Layer
Trait Implementations
impl<'_, T: USBKeyOut> ProcessKeys<T> for Layer<'_>
[src]
fn process_keys(
&mut self,
events: &mut Vec<(Event, EventStatus)>,
output: &mut T
) -> HandlerResult
[src]
&mut self,
events: &mut Vec<(Event, EventStatus)>,
output: &mut T
) -> HandlerResult
fn default_enabled(&self) -> bool
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
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>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,