on xenial help sign in
Another solution.
f78a1b0Josh Arenson
qml/OrientedShell.qml+12−18
@@ -78,13 +78,8 @@ Rectangle {
78 InputDeviceModel {
78 InputDeviceModel {
79 id: keyboardsModel
79 id: keyboardsModel
80 deviceFilter: InputInfo.Keyboard
80 deviceFilter: InputInfo.Keyboard
81− onDeviceAdded: {
82− root.forceOSKEnabled = autopilotDevices.autopilotDevicePresent();
81+ onDeviceAdded: forceOSKEnabled = autopilotDevicePresent();
83− }
84−
85− onDeviceRemoved: {
86− root.forceOSKEnabled = autopilotDevices.autopilotDevicePresent();
82+ onDeviceRemoved: forceOSKEnabled = autopilotDevicePresent();
87− }
88 }
83 }
89
84
90 InputDeviceModel {
85 InputDeviceModel {
@@ -92,26 +87,25 @@ Rectangle {
92 deviceFilter: InputInfo.TouchScreen
87 deviceFilter: InputInfo.TouchScreen
93 }
88 }
94
89
95− /* FIXME: This is a work arround for lp:1542224.
90+ /* FIXME: This exposes the NameRole as a work arround for lp:1542224.
96− * When QInputInfo exposes NameRole to QML, the filtering should
91+ * When QInputInfo exposes NameRole to QML, this should be removed.
97− * happen in the backend.
98 */
92 */
99 property bool forceOSKEnabled: false
93 property bool forceOSKEnabled: false
100 property var autopilotEmulatedDeviceNames: ["py-evdev-uinput"]
94 property var autopilotEmulatedDeviceNames: ["py-evdev-uinput"]
101 UnitySortFilterProxyModel {
95 UnitySortFilterProxyModel {
102 id: autopilotDevices
96 id: autopilotDevices
103 model: keyboardsModel
97 model: keyboardsModel
98+ }
104
99
105− function autopilotdDevicePresent() {
100+ function autopilotDevicePresent() {
106− for(var i = 0; i < count; i++) {
101+ for(var i = 0; i < autopilotDevices.count; i++) {
107− var device = get(i);
102+ var device = autopilotDevices.get(i);
108− if (autopilotEmulatedDeviceNames.indexOf(device.name) != -1) {
103+ if (autopilotEmulatedDeviceNames.indexOf(device.name) != -1) {
109− console.warn("Forcing the OSK to be enabled as there is an autopilot eumlated device present.")
104+ console.warn("Forcing the OSK to be enabled as there is an autopilot eumlated device present.")
110− return true;
105+ return true;
111− }
112 }
106 }
113− return false;
114 }
107 }
108+ return false;
115 }
109 }
116
110
117 Screens {
111 Screens {