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: Address
The 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 more