Struct UIKeyboardHIDUsage

Source
#[repr(transparent)]
pub struct UIKeyboardHIDUsage(pub CFIndex);
Available on crate features UIKeyConstants and objc2-core-foundation only.
Expand description

This file defines a table of standardized key codes, called “HID usages” used by USB keyboards to identify individual keys.

A general note on Usages and languages: Due to the variation of keyboards from language to language, it is not feasible to specify exact key mappings for every language. Where this list is not specific for a key function in a language, the closest equivalent key position should be used, so that a keyboard may be modified for a different language by simply printing different keycaps. One example is the Y key on a North American keyboard. In Germany this is typically Z. Rather than changing the keyboard firmware to put the Z Usage into that place in the descriptor list, the vendor uses the Y Usage on both the North American and German keyboards. This continues to be the existing practice in the industry, in order to minimize the number of changes to the electronics to accommodate other languages.

The following constants are from the USB ‘HID Usage Tables’ specification, revision 1.1rc3.

See also Apple’s documentation

Tuple Fields§

§0: CFIndex

Implementations§

Source§

impl UIKeyboardHIDUsage

Source

pub const KeyboardErrorRollOver: Self

Source

pub const KeyboardPOSTFail: Self

Source

pub const KeyboardErrorUndefined: Self

Source

pub const KeyboardA: Self

Source

pub const KeyboardB: Self

Source

pub const KeyboardC: Self

Source

pub const KeyboardD: Self

Source

pub const KeyboardE: Self

Source

pub const KeyboardF: Self

Source

pub const KeyboardG: Self

Source

pub const KeyboardH: Self

Source

pub const KeyboardI: Self

Source

pub const KeyboardJ: Self

Source

pub const KeyboardK: Self

Source

pub const KeyboardL: Self

Source

pub const KeyboardM: Self

Source

pub const KeyboardN: Self

Source

pub const KeyboardO: Self

Source

pub const KeyboardP: Self

Source

pub const KeyboardQ: Self

Source

pub const KeyboardR: Self

Source

pub const KeyboardS: Self

Source

pub const KeyboardT: Self

Source

pub const KeyboardU: Self

Source

pub const KeyboardV: Self

Source

pub const KeyboardW: Self

Source

pub const KeyboardX: Self

Source

pub const KeyboardY: Self

Source

pub const KeyboardZ: Self

Source

pub const Keyboard1: Self

Source

pub const Keyboard2: Self

Source

pub const Keyboard3: Self

Source

pub const Keyboard4: Self

Source

pub const Keyboard5: Self

Source

pub const Keyboard6: Self

Source

pub const Keyboard7: Self

Source

pub const Keyboard8: Self

Source

pub const Keyboard9: Self

Source

pub const Keyboard0: Self

Source

pub const KeyboardReturnOrEnter: Self

Source

pub const KeyboardEscape: Self

Source

pub const KeyboardDeleteOrBackspace: Self

Source

pub const KeyboardTab: Self

Source

pub const KeyboardSpacebar: Self

Source

pub const KeyboardHyphen: Self

Source

pub const KeyboardEqualSign: Self

Source

pub const KeyboardOpenBracket: Self

Source

pub const KeyboardCloseBracket: Self

Source

pub const KeyboardBackslash: Self

Source

pub const KeyboardNonUSPound: Self

Source

pub const KeyboardSemicolon: Self

Source

pub const KeyboardQuote: Self

Source

pub const KeyboardGraveAccentAndTilde: Self

Source

pub const KeyboardComma: Self

Source

pub const KeyboardPeriod: Self

Source

pub const KeyboardSlash: Self

Source

pub const KeyboardCapsLock: Self

Source

pub const KeyboardF1: Self

Source

pub const KeyboardF2: Self

Source

pub const KeyboardF3: Self

Source

pub const KeyboardF4: Self

Source

pub const KeyboardF5: Self

Source

pub const KeyboardF6: Self

Source

pub const KeyboardF7: Self

Source

pub const KeyboardF8: Self

Source

pub const KeyboardF9: Self

Source

pub const KeyboardF10: Self

Source

pub const KeyboardF11: Self

Source

pub const KeyboardF12: Self

Source

pub const KeyboardPrintScreen: Self

Source

pub const KeyboardScrollLock: Self

Source

pub const KeyboardPause: Self

Source

pub const KeyboardInsert: Self

Source

pub const KeyboardHome: Self

Source

pub const KeyboardPageUp: Self

Source

pub const KeyboardDeleteForward: Self

Source

pub const KeyboardEnd: Self

Source

pub const KeyboardPageDown: Self

Source

pub const KeyboardRightArrow: Self

Source

pub const KeyboardLeftArrow: Self

Source

pub const KeyboardDownArrow: Self

Source

pub const KeyboardUpArrow: Self

Source

pub const KeypadNumLock: Self

Source

pub const KeypadSlash: Self

Source

pub const KeypadAsterisk: Self

Source

pub const KeypadHyphen: Self

Source

pub const KeypadPlus: Self

Source

pub const KeypadEnter: Self

Source

pub const Keypad1: Self

Source

pub const Keypad2: Self

Source

pub const Keypad3: Self

Source

pub const Keypad4: Self

Source

pub const Keypad5: Self

Source

pub const Keypad6: Self

Source

pub const Keypad7: Self

Source

pub const Keypad8: Self

Source

pub const Keypad9: Self

Source

pub const Keypad0: Self

Source

pub const KeypadPeriod: Self

Source

pub const KeyboardNonUSBackslash: Self

Source

pub const KeyboardApplication: Self

Source

pub const KeyboardPower: Self

Source

pub const KeypadEqualSign: Self

Source

pub const KeyboardF13: Self

Source

pub const KeyboardF14: Self

Source

pub const KeyboardF15: Self

Source

pub const KeyboardF16: Self

Source

pub const KeyboardF17: Self

Source

pub const KeyboardF18: Self

Source

pub const KeyboardF19: Self

Source

pub const KeyboardF20: Self

Source

pub const KeyboardF21: Self

Source

pub const KeyboardF22: Self

Source

pub const KeyboardF23: Self

Source

pub const KeyboardF24: Self

Source

pub const KeyboardExecute: Self

Source

pub const KeyboardHelp: Self

Source

pub const KeyboardMenu: Self

Source

pub const KeyboardSelect: Self

Source

pub const KeyboardStop: Self

Source

pub const KeyboardAgain: Self

Source

pub const KeyboardUndo: Self

Source

pub const KeyboardCut: Self

Source

pub const KeyboardCopy: Self

Source

pub const KeyboardPaste: Self

Source

pub const KeyboardFind: Self

Source

pub const KeyboardMute: Self

Source

pub const KeyboardVolumeUp: Self

Source

pub const KeyboardVolumeDown: Self

Source

pub const KeyboardLockingCapsLock: Self

Source

pub const KeyboardLockingNumLock: Self

Source

pub const KeyboardLockingScrollLock: Self

Source

pub const KeypadComma: Self

Source

pub const KeypadEqualSignAS400: Self

Source

pub const KeyboardInternational1: Self

Source

pub const KeyboardInternational2: Self

Source

pub const KeyboardInternational3: Self

Source

pub const KeyboardInternational4: Self

Source

pub const KeyboardInternational5: Self

Source

pub const KeyboardInternational6: Self

Source

pub const KeyboardInternational7: Self

Source

pub const KeyboardInternational8: Self

Source

pub const KeyboardInternational9: Self

Source

pub const KeyboardLANG1: Self

Source

pub const KeyboardLANG2: Self

Source

pub const KeyboardLANG3: Self

Source

pub const KeyboardLANG4: Self

Source

pub const KeyboardLANG5: Self

Source

pub const KeyboardLANG6: Self

Source

pub const KeyboardLANG7: Self

Source

pub const KeyboardLANG8: Self

Source

pub const KeyboardLANG9: Self

Source

pub const KeyboardAlternateErase: Self

Source

pub const KeyboardSysReqOrAttention: Self

Source

pub const KeyboardCancel: Self

Source

pub const KeyboardClear: Self

Source

pub const KeyboardPrior: Self

Source

pub const KeyboardReturn: Self

Source

pub const KeyboardSeparator: Self

Source

pub const KeyboardOut: Self

Source

pub const KeyboardOper: Self

Source

pub const KeyboardClearOrAgain: Self

Source

pub const KeyboardCrSelOrProps: Self

Source

pub const KeyboardExSel: Self

Source

pub const KeyboardLeftControl: Self

Source

pub const KeyboardLeftShift: Self

Source

pub const KeyboardLeftAlt: Self

Source

pub const KeyboardLeftGUI: Self

Source

pub const KeyboardRightControl: Self

Source

pub const KeyboardRightShift: Self

Source

pub const KeyboardRightAlt: Self

Source

pub const KeyboardRightGUI: Self

Source

pub const Keyboard_Reserved: Self

Source

pub const KeyboardHangul: Self

Source

pub const KeyboardHanja: Self

Source

pub const KeyboardKanaSwitch: Self

Source

pub const KeyboardAlphanumericSwitch: Self

Source

pub const KeyboardKatakana: Self

Source

pub const KeyboardHiragana: Self

Source

pub const KeyboardZenkakuHankakuKanji: Self

Trait Implementations§

Source§

impl Clone for UIKeyboardHIDUsage

Source§

fn clone(&self) -> UIKeyboardHIDUsage

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for UIKeyboardHIDUsage

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Encode for UIKeyboardHIDUsage

Source§

const ENCODING: Encoding = CFIndex::ENCODING

The Objective-C type-encoding for this type.
Source§

impl Hash for UIKeyboardHIDUsage

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for UIKeyboardHIDUsage

Source§

fn cmp(&self, other: &UIKeyboardHIDUsage) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for UIKeyboardHIDUsage

Source§

fn eq(&self, other: &UIKeyboardHIDUsage) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for UIKeyboardHIDUsage

Source§

fn partial_cmp(&self, other: &UIKeyboardHIDUsage) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl RefEncode for UIKeyboardHIDUsage

Source§

const ENCODING_REF: Encoding

The Objective-C type-encoding for a reference of this type. Read more
Source§

impl Copy for UIKeyboardHIDUsage

Source§

impl Eq for UIKeyboardHIDUsage

Source§

impl StructuralPartialEq for UIKeyboardHIDUsage

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> EncodeArgument for T
where T: Encode,

Source§

const ENCODING_ARGUMENT: Encoding = T::ENCODING

The Objective-C type-encoding for this type.
Source§

impl<T> EncodeReturn for T
where T: Encode,

Source§

const ENCODING_RETURN: Encoding = T::ENCODING

The Objective-C type-encoding for this type.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> AutoreleaseSafe for T
where T: ?Sized,