Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(739)

Unified Diff: ui/events/event.h

Issue 336403005: Use XInput2 events for keyboard events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments (sadrul) 3 Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/aura/window_tree_host_x11.cc ('k') | ui/events/event.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/event.h
diff --git a/ui/events/event.h b/ui/events/event.h
index 35f3e59d389bc1b99e1f7c0b034b03679d863ec0..1857d594b66d75d14a3eaaff8261d94845d1b3b7 100644
--- a/ui/events/event.h
+++ b/ui/events/event.h
@@ -68,6 +68,8 @@ class EVENTS_EXPORT Event {
const LatencyInfo* latency() const { return &latency_; }
void set_latency(const LatencyInfo& latency) { latency_ = latency; }
+ int source_device_id() const { return source_device_id_; }
+
// By default, events are "cancelable", this means any default processing that
// the containing abstraction layer may perform can be prevented by calling
// SetHandled(). SetHandled() or StopPropagation() must not be called for
@@ -230,6 +232,10 @@ class EVENTS_EXPORT Event {
EventTarget* target_;
EventPhase phase_;
EventResult result_;
+
+ // The device id the event came from, or ED_UNKNOWN_DEVICE if the information
+ // is not available.
+ int source_device_id_;
};
class EVENTS_EXPORT CancelModeEvent : public Event {
@@ -388,6 +394,7 @@ class EVENTS_EXPORT MouseEvent : public LocatedEvent {
// NOTE: during a press and release flags() contains the complete set of
// flags. Use this to determine the button that was pressed or released.
int changed_button_flags() const { return changed_button_flags_; }
+ void set_changed_button_flags(int flags) { changed_button_flags_ = flags; }
private:
// Returns the repeat count based on the previous mouse click, if it is
@@ -455,8 +462,7 @@ class EVENTS_EXPORT TouchEvent : public LocatedEvent {
radius_x_(model.radius_x_),
radius_y_(model.radius_y_),
rotation_angle_(model.rotation_angle_),
- force_(model.force_),
- source_device_id_(model.source_device_id_) {
+ force_(model.force_) {
}
TouchEvent(EventType type,
@@ -481,14 +487,10 @@ class EVENTS_EXPORT TouchEvent : public LocatedEvent {
float radius_y() const { return radius_y_; }
float rotation_angle() const { return rotation_angle_; }
float force() const { return force_; }
- int source_device_id() const { return source_device_id_; }
// Used for unit tests.
void set_radius_x(const float r) { radius_x_ = r; }
void set_radius_y(const float r) { radius_y_ = r; }
- void set_source_device_id(int source_device_id) {
- source_device_id_ = source_device_id;
- }
// Overridden from LocatedEvent.
virtual void UpdateForRootTransform(
@@ -522,9 +524,6 @@ class EVENTS_EXPORT TouchEvent : public LocatedEvent {
// Force (pressure) of the touch. Normalized to be [0, 1]. Default to be 0.0.
float force_;
-
- // The device id of the screen the event came from. Default to be -1.
- int source_device_id_;
};
class EVENTS_EXPORT KeyEvent : public Event {
« no previous file with comments | « ui/aura/window_tree_host_x11.cc ('k') | ui/events/event.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698