[][src]Enum keyberon::layout::Event

pub enum Event {
    Press(u8, u8),
    Release(u8, u8),
}

An event on the key matrix.

Variants

Press(u8, u8)

Press event with coordinates (i, j).

Release(u8, u8)

Release event with coordinates (i, j).

Implementations

impl Event[src]

pub fn coord(self) -> (u8, u8)[src]

Returns the coordinates (i, j) of the event.

pub fn transform(self, f: impl FnOnce(u8, u8) -> (u8, u8)) -> Self[src]

Transforms the coordinates of the event.

Example

assert_eq!(
    Event::Press(3, 10),
    Event::Press(3, 1).transform(|i, j| (i, 11 - j)),
);

Trait Implementations

impl Clone for Event[src]

impl Copy for Event[src]

impl Debug for Event[src]

impl Eq for Event[src]

impl PartialEq<Event> for Event[src]

impl StructuralEq for Event[src]

impl StructuralPartialEq for Event[src]

Auto Trait Implementations

impl Send for Event

impl Sync for Event

impl Unpin for Event

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

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]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.