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

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 6 years 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
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 4e517216b015f093444b79b434977f2d5d611247..aa00bf413c07cd81871f2e6bb3f88981ec6db5bb 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,47 @@ 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()) {
+ 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()) {
+ 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())

Powered by Google App Engine
This is Rietveld 408576698