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

Side by Side Diff: ui/events/ozone/evdev/libgestures_glue/event_reader_libevdev_cros.h

Issue 990483002: ozone: evdev: Fix possibility of stuck keys with libevdev (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « no previous file | ui/events/ozone/evdev/libgestures_glue/event_reader_libevdev_cros.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_EVDEV_LIBGESTURES_GLUE_EVENT_READER_LIBEVDEV_CROS_H_ 5 #ifndef UI_EVENTS_OZONE_EVDEV_LIBGESTURES_GLUE_EVENT_READER_LIBEVDEV_CROS_H_
6 #define UI_EVENTS_OZONE_EVDEV_LIBGESTURES_GLUE_EVENT_READER_LIBEVDEV_CROS_H_ 6 #define UI_EVENTS_OZONE_EVDEV_LIBGESTURES_GLUE_EVENT_READER_LIBEVDEV_CROS_H_
7 7
8 #include <libevdev/libevdev.h> 8 #include <libevdev/libevdev.h>
9 9
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 17 matching lines...) Expand all
28 virtual ~Delegate(); 28 virtual ~Delegate();
29 29
30 // Notifier for open. This is called with the initial event state. 30 // Notifier for open. This is called with the initial event state.
31 virtual void OnLibEvdevCrosOpen(Evdev* evdev, EventStateRec* evstate) = 0; 31 virtual void OnLibEvdevCrosOpen(Evdev* evdev, EventStateRec* evstate) = 0;
32 32
33 // Notifier for event. This is called with the updated event state. 33 // Notifier for event. This is called with the updated event state.
34 virtual void OnLibEvdevCrosEvent(Evdev* evdev, 34 virtual void OnLibEvdevCrosEvent(Evdev* evdev,
35 EventStateRec* state, 35 EventStateRec* state,
36 const timeval& time) = 0; 36 const timeval& time) = 0;
37 37
38 // Notifier for stop. This is called with the final event state.
39 virtual void OnLibEvdevCrosStopped(Evdev* evdev, EventStateRec* state) = 0;
40
38 // Sets which keyboard keys should be processed. 41 // Sets which keyboard keys should be processed.
39 virtual void SetAllowedKeys(scoped_ptr<std::set<DomCode>> allowed_keys) = 0; 42 virtual void SetAllowedKeys(scoped_ptr<std::set<DomCode>> allowed_keys) = 0;
40 43
41 // Allows all keys to be processed. 44 // Allows all keys to be processed.
42 virtual void AllowAllKeys() = 0; 45 virtual void AllowAllKeys() = 0;
43 }; 46 };
44 47
45 EventReaderLibevdevCros(int fd, 48 EventReaderLibevdevCros(int fd,
46 const base::FilePath& path, 49 const base::FilePath& path,
47 int id, 50 int id,
48 InputDeviceType type, 51 InputDeviceType type,
49 const EventDeviceInfo& devinfo, 52 const EventDeviceInfo& devinfo,
50 scoped_ptr<Delegate> delegate); 53 scoped_ptr<Delegate> delegate);
51 ~EventReaderLibevdevCros() override; 54 ~EventReaderLibevdevCros() override;
52 55
53 // EventConverterEvdev: 56 // EventConverterEvdev:
54 void OnFileCanReadWithoutBlocking(int fd) override; 57 void OnFileCanReadWithoutBlocking(int fd) override;
55 bool HasKeyboard() const override; 58 bool HasKeyboard() const override;
56 bool HasMouse() const override; 59 bool HasMouse() const override;
57 bool HasTouchpad() const override; 60 bool HasTouchpad() const override;
58 bool HasCapsLockLed() const override; 61 bool HasCapsLockLed() const override;
59 void SetAllowedKeys(scoped_ptr<std::set<DomCode>> allowed_keys) override; 62 void SetAllowedKeys(scoped_ptr<std::set<DomCode>> allowed_keys) override;
60 void AllowAllKeys() override; 63 void AllowAllKeys() override;
64 void OnStopped() override;
61 65
62 private: 66 private:
63 static void OnSynReport(void* data, 67 static void OnSynReport(void* data,
64 EventStateRec* evstate, 68 EventStateRec* evstate,
65 struct timeval* tv); 69 struct timeval* tv);
66 static void OnLogMessage(void*, int level, const char*, ...); 70 static void OnLogMessage(void*, int level, const char*, ...);
67 71
68 // Input modalities for this device. 72 // Input modalities for this device.
69 bool has_keyboard_; 73 bool has_keyboard_;
70 bool has_mouse_; 74 bool has_mouse_;
(...skipping 13 matching lines...) Expand all
84 88
85 // Delegate for event processing. 89 // Delegate for event processing.
86 scoped_ptr<Delegate> delegate_; 90 scoped_ptr<Delegate> delegate_;
87 91
88 DISALLOW_COPY_AND_ASSIGN(EventReaderLibevdevCros); 92 DISALLOW_COPY_AND_ASSIGN(EventReaderLibevdevCros);
89 }; 93 };
90 94
91 } // namspace ui 95 } // namspace ui
92 96
93 #endif // UI_EVENTS_OZONE_EVDEV_LIBGESTURES_GLUE_EVENT_READER_LIBEVDEV_CROS_H_ 97 #endif // UI_EVENTS_OZONE_EVDEV_LIBGESTURES_GLUE_EVENT_READER_LIBEVDEV_CROS_H_
OLDNEW
« no previous file with comments | « no previous file | ui/events/ozone/evdev/libgestures_glue/event_reader_libevdev_cros.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698