Struct oc_wasm_opencomputers::keyboard::BasicKeySignal
source · pub struct BasicKeySignal {
pub keyboard: Address,
pub character: Option<char>,
pub keycode: Option<NonZeroU32>,
}Expand description
Information about a key press or release event, excluding the name of the player who pressed or released the key.
This structure, unlike KeySignal, is fully owned. Thus, a typical application
which does not care about the player name can convert a KeySignal into a
BasicKeySignal in order to regain use of the decode buffer.
Fields§
§keyboard: AddressThe address of the keyboard component.
character: Option<char>The character that was pressed or released, if any.
This is None if the event does not produce a character. Examples of
non-character-producing key events are events related to lock keys, arrow keys, modifier
keys, navigation keys, or other special keys.
keycode: Option<NonZeroU32>The keycode that was pressed or released, if any.
This is None if the event does not have a keycode. One example of a non-keycode-producing
key event is a composed character; in this case, the individual keystrokes are not
reported, but the composed character is reported as a character without associated keycode.
Another example is a Windows key (aka super key) or Menu key, both of which (under some
operating systems at least) send key signals with neither character nor keycode filled
in.
Trait Implementations§
source§impl Clone for BasicKeySignal
impl Clone for BasicKeySignal
source§fn clone(&self) -> BasicKeySignal
fn clone(&self) -> BasicKeySignal
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for BasicKeySignal
impl Debug for BasicKeySignal
source§impl<'buffer> From<&KeySignal<'buffer>> for BasicKeySignal
impl<'buffer> From<&KeySignal<'buffer>> for BasicKeySignal
source§impl Hash for BasicKeySignal
impl Hash for BasicKeySignal
source§impl Ord for BasicKeySignal
impl Ord for BasicKeySignal
source§fn cmp(&self, other: &BasicKeySignal) -> Ordering
fn cmp(&self, other: &BasicKeySignal) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for BasicKeySignal
impl PartialEq for BasicKeySignal
source§fn eq(&self, other: &BasicKeySignal) -> bool
fn eq(&self, other: &BasicKeySignal) -> bool
self and other values to be equal, and is used
by ==.source§impl PartialOrd for BasicKeySignal
impl PartialOrd for BasicKeySignal
source§fn partial_cmp(&self, other: &BasicKeySignal) -> Option<Ordering>
fn partial_cmp(&self, other: &BasicKeySignal) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read more