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

Side by Side Diff: ui/events/ozone/evdev/tablet_event_converter_evdev.h

Issue 847663004: ozone: Handle on-screen stylus support consistently (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_EVENTS_OZONE_TABLET_EVENT_CONVERTER_EVDEV_H_ 5 #ifndef UI_EVENTS_OZONE_TABLET_EVENT_CONVERTER_EVDEV_H_
6 #define UI_EVENTS_OZONE_TABLET_EVENT_CONVERTER_EVDEV_H_ 6 #define UI_EVENTS_OZONE_TABLET_EVENT_CONVERTER_EVDEV_H_
7 7
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/message_loop/message_pump_libevent.h" 9 #include "base/message_loop/message_pump_libevent.h"
10 #include "ui/events/event.h" 10 #include "ui/events/event.h"
(...skipping 23 matching lines...) Expand all
34 // EventConverterEvdev: 34 // EventConverterEvdev:
35 void OnFileCanReadWithoutBlocking(int fd) override; 35 void OnFileCanReadWithoutBlocking(int fd) override;
36 36
37 void ProcessEvents(const struct input_event* inputs, int count); 37 void ProcessEvents(const struct input_event* inputs, int count);
38 38
39 private: 39 private:
40 friend class MockTabletEventConverterEvdev; 40 friend class MockTabletEventConverterEvdev;
41 void ConvertKeyEvent(const input_event& input); 41 void ConvertKeyEvent(const input_event& input);
42 void ConvertAbsEvent(const input_event& input); 42 void ConvertAbsEvent(const input_event& input);
43 void DispatchMouseButton(const input_event& input); 43 void DispatchMouseButton(const input_event& input);
44 void DispatchTouch(const input_event& input);
44 void UpdateCursor(); 45 void UpdateCursor();
45 46
46 // Flush events delimited by EV_SYN. This is useful for handling 47 // Flush events delimited by EV_SYN. This is useful for handling
47 // non-axis-aligned movement properly. 48 // non-axis-aligned movement properly.
48 void FlushEvents(); 49 void FlushEvents(const input_event& input);
49 50
50 // Controller for watching the input fd. 51 // Controller for watching the input fd.
51 base::MessagePumpLibevent::FileDescriptorWatcher controller_; 52 base::MessagePumpLibevent::FileDescriptorWatcher controller_;
52 53
53 // Shared cursor state. 54 // Shared cursor state.
54 CursorDelegateEvdev* cursor_; 55 CursorDelegateEvdev* cursor_;
55 56
56 // Modifier key state (shift, ctrl, etc). 57 // Modifier key state (shift, ctrl, etc).
57 EventModifiersEvdev* modifiers_; 58 EventModifiersEvdev* modifiers_;
58 59
59 // Callback for dispatching events. 60 // Callback for dispatching events.
60 EventDispatchCallback callback_; 61 EventDispatchCallback callback_;
61 62
62 int y_abs_location_; 63 int y_abs_location_;
63 int x_abs_location_; 64 int x_abs_location_;
65 int pressure_;
64 int x_abs_min_; 66 int x_abs_min_;
65 int y_abs_min_; 67 int y_abs_min_;
68 int pressure_min_;
66 int x_abs_range_; 69 int x_abs_range_;
67 int y_abs_range_; 70 int y_abs_range_;
71 int pressure_range_;
68 72
69 // BTN_TOOL_ code for the active device 73 // BTN_TOOL_ code for the active device
70 int stylus_; 74 int stylus_;
71 75
72 // Whether we need to move the cursor 76 // Whether we need to move the cursor
73 bool abs_value_dirty_; 77 bool abs_value_dirty_;
74 78
79 // For on-screen active stylus generate touch events
80 bool on_screen_stylus_;
81
82 // Emit touch events for motion vs mouse
83 bool emit_touch_;
84
75 DISALLOW_COPY_AND_ASSIGN(TabletEventConverterEvdev); 85 DISALLOW_COPY_AND_ASSIGN(TabletEventConverterEvdev);
76 }; 86 };
77 87
78 } // namespace ui 88 } // namespace ui
79 89
80 #endif // UI_EVENTS_OZONE_TABLET_EVENT_CONVERTER_EVDEV_H_ 90 #endif // UI_EVENTS_OZONE_TABLET_EVENT_CONVERTER_EVDEV_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698