| 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())
|
|
|