Make DeviceId contain device id's on Android
This commit is contained in:
parent
8393d98940
commit
c7cf0cfd83
2 changed files with 5 additions and 4 deletions
|
|
@ -26,6 +26,7 @@ And please only add new entries to the top of this list, right below the `# Unre
|
||||||
- On X11, fix event loop not waking up on `ControlFlow::Poll` and `ControlFlow::WaitUntil`.
|
- On X11, fix event loop not waking up on `ControlFlow::Poll` and `ControlFlow::WaitUntil`.
|
||||||
- **Breaking:** Change default `ControlFlow` from `Poll` to `Wait`.
|
- **Breaking:** Change default `ControlFlow` from `Poll` to `Wait`.
|
||||||
- **Breaking:** remove `DeviceEvent::Text`.
|
- **Breaking:** remove `DeviceEvent::Text`.
|
||||||
|
- On Android, fix `DeviceId` to contain device id's.
|
||||||
|
|
||||||
# 0.29.1-beta
|
# 0.29.1-beta
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -387,7 +387,7 @@ impl<T: 'static> EventLoop<T> {
|
||||||
match event {
|
match event {
|
||||||
InputEvent::MotionEvent(motion_event) => {
|
InputEvent::MotionEvent(motion_event) => {
|
||||||
let window_id = window::WindowId(WindowId);
|
let window_id = window::WindowId(WindowId);
|
||||||
let device_id = event::DeviceId(DeviceId);
|
let device_id = event::DeviceId(DeviceId(motion_event.device_id()));
|
||||||
|
|
||||||
let phase = match motion_event.action() {
|
let phase = match motion_event.action() {
|
||||||
MotionAction::Down | MotionAction::PointerDown => {
|
MotionAction::Down | MotionAction::PointerDown => {
|
||||||
|
|
@ -459,7 +459,7 @@ impl<T: 'static> EventLoop<T> {
|
||||||
let event = event::Event::WindowEvent {
|
let event = event::Event::WindowEvent {
|
||||||
window_id: window::WindowId(WindowId),
|
window_id: window::WindowId(WindowId),
|
||||||
event: event::WindowEvent::KeyboardInput {
|
event: event::WindowEvent::KeyboardInput {
|
||||||
device_id: event::DeviceId(DeviceId),
|
device_id: event::DeviceId(DeviceId(key.device_id())),
|
||||||
event: event::KeyEvent {
|
event: event::KeyEvent {
|
||||||
state,
|
state,
|
||||||
physical_key: keycodes::to_physical_keycode(keycode),
|
physical_key: keycodes::to_physical_keycode(keycode),
|
||||||
|
|
@ -739,11 +739,11 @@ impl From<u64> for WindowId {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
|
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
|
||||||
pub struct DeviceId;
|
pub struct DeviceId(i32);
|
||||||
|
|
||||||
impl DeviceId {
|
impl DeviceId {
|
||||||
pub const fn dummy() -> Self {
|
pub const fn dummy() -> Self {
|
||||||
DeviceId
|
DeviceId(0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue