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

Unified Diff: ui/events/ozone/evdev/event_factory_evdev.cc

Issue 806693009: Port ScopedDisableInternalMouseAndKeyboardX11 to Ozone (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/events/ozone/evdev/event_factory_evdev.h ('k') | ui/events/ozone/evdev/input_controller_evdev.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/ozone/evdev/event_factory_evdev.cc
diff --git a/ui/events/ozone/evdev/event_factory_evdev.cc b/ui/events/ozone/evdev/event_factory_evdev.cc
index b5a0cb75cdba1defeba1cb5c64ef4bdfdb280a87..ea8766d103b0a96db500f9081ffd1214f854006d 100644
--- a/ui/events/ozone/evdev/event_factory_evdev.cc
+++ b/ui/events/ozone/evdev/event_factory_evdev.cc
@@ -62,9 +62,8 @@ struct OpenInputDeviceParams {
#if defined(USE_EVDEV_GESTURES)
bool UseGesturesLibraryForDevice(const EventDeviceInfo& devinfo) {
- if ((devinfo.HasAbsXY() || devinfo.HasMTAbsXY()) &&
- !devinfo.IsMappedToScreen())
- return true; // touchpad
+ if (devinfo.HasTouchpad())
+ return true;
if (devinfo.HasRelXY())
return true; // mouse
@@ -315,6 +314,49 @@ void EventFactoryEvdev::WarpCursorTo(gfx::AcceleratedWidget widget,
}
}
+void EventFactoryEvdev::DisableInternalTouchpad() {
+ for (const auto& it : converters_) {
+ EventConverterEvdev* converter = it.second;
+ if (converter->type() == InputDeviceType::INPUT_DEVICE_INTERNAL &&
+ converter->HasTouchpad()) {
+ DCHECK(!converter->HasKeyboard());
+ converter->set_ignore_events(true);
+ }
+ }
+}
+
+void EventFactoryEvdev::EnableInternalTouchpad() {
+ for (const auto& it : converters_) {
+ EventConverterEvdev* converter = it.second;
+ if (converter->type() == InputDeviceType::INPUT_DEVICE_INTERNAL &&
+ converter->HasTouchpad()) {
+ DCHECK(!converter->HasKeyboard());
+ converter->set_ignore_events(false);
+ }
+ }
+}
+
+void EventFactoryEvdev::DisableInternalKeyboardExceptKeys(
+ scoped_ptr<std::set<DomCode>> excepted_keys) {
+ for (const auto& it : converters_) {
+ EventConverterEvdev* converter = it.second;
+ if (converter->type() == InputDeviceType::INPUT_DEVICE_INTERNAL &&
+ converter->HasKeyboard()) {
+ converter->SetAllowedKeys(excepted_keys.Pass());
+ }
+ }
+}
+
+void EventFactoryEvdev::EnableInternalKeyboard() {
+ for (const auto& it : converters_) {
+ EventConverterEvdev* converter = it.second;
+ if (converter->type() == InputDeviceType::INPUT_DEVICE_INTERNAL &&
+ converter->HasKeyboard()) {
+ converter->AllowAllKeys();
+ }
+ }
+}
+
void EventFactoryEvdev::NotifyDeviceChange(
const EventConverterEvdev& converter) {
if (converter.HasTouchscreen())
« no previous file with comments | « ui/events/ozone/evdev/event_factory_evdev.h ('k') | ui/events/ozone/evdev/input_controller_evdev.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698