Richer input events

This expands input events to represent sub-pixel mouse positions, devices responsible for generating events, and raw
device-oriented events. The X11 back end is refactored to make full use of the new expressiveness. Other backends have
had new functionality minimally stubbed out, save for the macos backend which already supports sub-pixel mouse
positions.
This commit is contained in:
Benjamin Saunders 2017-04-22 13:52:35 -07:00
parent 544ee13bf3
commit 22bc119cd7
19 changed files with 994 additions and 786 deletions

View file

@ -287,6 +287,7 @@ impl Window {
let phase: i32 = msg_send![touch, phase];
state.events_queue.push_back(Event::Touch(Touch {
device_id: DEVICE_ID,
id: touch_id,
location: (location.x as f64, location.y as f64),
phase: match phase {
@ -495,3 +496,6 @@ impl<'a> Iterator for PollEventsIterator<'a> {
}
}
}
// Constant device ID, to be removed when this backend is updated to report real device IDs.
const DEVICE_ID: ::DeviceId = ::DeviceId(DeviceId);