redraw/event/keyboard

KeyboardEvent objects describe a user interaction with the keyboard; each event describes a single interaction between the user and a key (or combination of a key with modifier keys) on the keyboard. The event type (keydown, keypress, or keyup) identifies what kind of keyboard activity occurred.

Types

pub type KeyboardEvent

Functions

pub fn alt_key(event: KeyboardEvent) -> Bool
pub fn as_event(event: KeyboardEvent) -> Event

KeyboardEvent inherits Event.

pub fn as_ui_event(event: KeyboardEvent) -> UIEvent

KeyboardEvent inherits UIEvent.

pub fn char_code(event: KeyboardEvent) -> Int

Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Do not use this property, as it is deprecated. Instead, get the Unicode value of the character using the key property.

pub fn code(event: KeyboardEvent) -> String
pub fn ctrl_key(event: KeyboardEvent) -> Bool
pub fn get_modifier_state(
  event: KeyboardEvent,
  key: String,
) -> Bool
pub fn key(event: KeyboardEvent) -> String
pub fn key_code(event: KeyboardEvent) -> Int

Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes.

pub fn locale(event: KeyboardEvent) -> String
pub fn location(event: KeyboardEvent) -> Float
pub fn meta_key(event: KeyboardEvent) -> Bool
pub fn repeat(event: KeyboardEvent) -> Bool
pub fn shift_key(event: KeyboardEvent) -> Bool
pub fn which(event: KeyboardEvent) -> Int

Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes.

Search Document