Enum android_activity::input::Source
source · #[non_exhaustive]#[repr(u32)]pub enum Source {
Show 15 variants
BluetoothStylus = 49_154,
Dpad = 513,
Gamepad = 1_025,
Hdmi = 33_554_433,
Joystick = 16_777_232,
Keyboard = 257,
Mouse = 8_194,
MouseRelative = 131_076,
RotaryEncoder = 4_194_304,
Sensor = 67_108_864,
Stylus = 16_386,
Touchpad = 1_048_584,
Touchscreen = 4_098,
TouchNavigation = 2_097_152,
Trackball = 65_540,
}
Expand description
An enum representing the source of an MotionEvent
or KeyEvent
§Android Extensible Enum
This is a runtime extensible enum and
should be handled similar to a #[non_exhaustive]
enum to maintain
forwards compatibility.
This implements Into<u32>
and From<u32>
for converting to/from Android
SDK integer values.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
BluetoothStylus = 49_154
Dpad = 513
Gamepad = 1_025
Either a gamepad or a joystick
Hdmi = 33_554_433
Joystick = 16_777_232
Either a gamepad or a joystick
Keyboard = 257
Pretty much any device with buttons. Query the keyboard type to determine if it has alphabetic keys and can be used for text entry.
Mouse = 8_194
A pointing device, such as a mouse or trackpad
MouseRelative = 131_076
A pointing device, such as a mouse or trackpad whose relative motions should be treated as navigation events
RotaryEncoder = 4_194_304
An input device akin to a scroll wheel
Sensor = 67_108_864
Stylus = 16_386
Touchpad = 1_048_584
Touchscreen = 4_098
Trackball = 65_540
Implementations§
source§impl Source
impl Source
pub fn is_pointer_class(self) -> bool
pub fn is_trackball_class(self) -> bool
pub fn is_position_class(self) -> bool
pub fn is_joystick_class(self) -> bool
Trait Implementations§
source§impl FromPrimitive for Source
impl FromPrimitive for Source
source§impl PartialEq for Source
impl PartialEq for Source
impl Copy for Source
impl Eq for Source
impl StructuralPartialEq for Source
Auto Trait Implementations§
impl Freeze for Source
impl RefUnwindSafe for Source
impl Send for Source
impl Sync for Source
impl Unpin for Source
impl UnwindSafe for Source
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more