on xenial help sign in
Change signals and cleanup.
e4820cdJosh Arenson
qml/OrientedShell.qml+13−8
@@ -89,19 +89,24 @@ Rectangle {
89 * When QInputInfo exposes NameRole to QML, the filtering should
89 * When QInputInfo exposes NameRole to QML, the filtering should
90 * happen in the backend.
90 * happen in the backend.
91 */
91 */
92− property bool blacklistedDevicePresent: false
92+ property bool forceOSKEnabled: false
93− property var blacklistedDeviceList: ["py-evdev-uinput"]
93+ property var autopilotEmulatedDeviceNames: ["py-evdev-uinput"]
94 UnitySortFilterProxyModel {
94 UnitySortFilterProxyModel {
95− id: blacklistedDevices
95+ id: autopilotDevices
96 model: keyboardsModel
96 model: keyboardsModel
97− onCountChanged: {
97+ onDeviceAdded: {
98− root.blacklistedDevicePresent = blacklistedDevicePresent();
98+ root.forceOSKEnabled = autopilotDevicePresent();
99 }
99 }
100
100
101− function blacklistedDevicePresent() {
101+ onDeviceRemoved: {
102+ root.forceOSKEnabled = autopilotDevicePresent();
103+ }
104+
105+ function autopilotdDevicePresent() {
102 for(var i = 0; i < count; i++) {
106 for(var i = 0; i < count; i++) {
103 var device = get(i);
107 var device = get(i);
104− if (blacklistedDeviceList.indexOf(device.name) != -1) {
108+ if (autopilotEmulatedDeviceNames.indexOf(device.name) != -1) {
109+ console.warn("Forcing the OSK to be enabled as there is an autopilot eumlated device present.")
105 return true;
110 return true;
106 }
111 }
107 }
112 }
@@ -221,7 +226,7 @@ Rectangle {
221 // thus hiding it here if there is a physical one around or if we have a second
226 // thus hiding it here if there is a physical one around or if we have a second
222 // screen (the virtual touchpad & osk on the phone) attached.
227 // screen (the virtual touchpad & osk on the phone) attached.
223 oskEnabled: (keyboardsModel.count === 0 && screens.count === 1) ||
228 oskEnabled: (keyboardsModel.count === 0 && screens.count === 1) ||
224− blacklistedDevicePresent
229+ forceOSKEnabled
225
230
226 // TODO: Factor in the connected input devices (eg: physical keyboard, mouse, touchscreen),
231 // TODO: Factor in the connected input devices (eg: physical keyboard, mouse, touchscreen),
227 // what's the output device (eg: big TV, desktop monitor, phone display), etc.
232 // what's the output device (eg: big TV, desktop monitor, phone display), etc.