Pass force on touch events on android
This commit is contained in:
parent
878d832d24
commit
2422ea39d0
3 changed files with 7 additions and 3 deletions
|
|
@ -89,6 +89,7 @@ And please only add new entries to the top of this list, right below the `# Unre
|
||||||
- **Breaking:** `with_x11_visual` now takes the visual ID instead of the bare pointer.
|
- **Breaking:** `with_x11_visual` now takes the visual ID instead of the bare pointer.
|
||||||
- On X11, add a `with_embedded_parent_window` function to the window builder to allow embedding a window into another window.
|
- On X11, add a `with_embedded_parent_window` function to the window builder to allow embedding a window into another window.
|
||||||
- On iOS, add force data to touch events when using the Apple Pencil.
|
- On iOS, add force data to touch events when using the Apple Pencil.
|
||||||
|
- On Android, add force data to touch events.
|
||||||
|
|
||||||
# 0.29.0-beta.0
|
# 0.29.0-beta.0
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -939,7 +939,10 @@ pub struct Touch {
|
||||||
///
|
///
|
||||||
/// ## Platform-specific
|
/// ## Platform-specific
|
||||||
///
|
///
|
||||||
/// - Only available on **iOS** 9.0+, **Windows** 8+, and **Web**.
|
/// - Only available on **iOS** 9.0+, **Windows** 8+, **Web**, and **Android**.
|
||||||
|
/// - **Android**: This will never be [None]. If the device doesn't support pressure
|
||||||
|
/// sensitivity, force will either be 0.0 or 1.0. Also see the
|
||||||
|
/// [android documentation](https://developer.android.com/reference/android/view/MotionEvent#AXIS_PRESSURE).
|
||||||
pub force: Option<Force>,
|
pub force: Option<Force>,
|
||||||
/// Unique identifier of a finger.
|
/// Unique identifier of a finger.
|
||||||
pub id: u64,
|
pub id: u64,
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ use raw_window_handle::{
|
||||||
use crate::{
|
use crate::{
|
||||||
dpi::{PhysicalPosition, PhysicalSize, Position, Size},
|
dpi::{PhysicalPosition, PhysicalSize, Position, Size},
|
||||||
error,
|
error,
|
||||||
event::{self, InnerSizeWriter, StartCause},
|
event::{self, Force, InnerSizeWriter, StartCause},
|
||||||
event_loop::{self, ControlFlow, DeviceEvents, EventLoopWindowTarget as RootELW},
|
event_loop::{self, ControlFlow, DeviceEvents, EventLoopWindowTarget as RootELW},
|
||||||
platform::pump_events::PumpStatus,
|
platform::pump_events::PumpStatus,
|
||||||
window::{
|
window::{
|
||||||
|
|
@ -426,7 +426,7 @@ impl<T: 'static> EventLoop<T> {
|
||||||
phase,
|
phase,
|
||||||
location,
|
location,
|
||||||
id: pointer.pointer_id() as u64,
|
id: pointer.pointer_id() as u64,
|
||||||
force: None,
|
force: Some(Force::Normalized(pointer.pressure() as f64)),
|
||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
callback(event, self.window_target());
|
callback(event, self.window_target());
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue