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

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 de5cfae56a8a70915ed296be79ffdb17905de534..404901e5d0ae7d3f3392b86e09ccda44374e8476 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
@@ -313,6 +312,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<ui::KeyboardCode>> 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