Android-x86
Fork
Faire un don

  • R/O
  • HTTP
  • SSH
  • HTTPS

hardware-libsensors: Commit

hardware/libsensors


Commit MetaInfo

Révisionf7725a96e7d1deacfd8d88821d36ad73d0071996 (tree)
l'heure2013-03-30 02:37:36
AuteurKyle Evans <kevans@andr...>
CommiterKyle Evans

Message de Log

add WMI hotkey support

SW_TABLET_MODE & KEY_DIRECTION, these are two events common to tablet
PC's. The first detects when the laptop is entering tablet mode and
rotates the screen to 90 if not already rotated, then back to 0 when
returning to laptop mode. The second is just a single button rotation
that can still be used when the keyboard is covered up.

Change Summary

Modification

--- a/kbdsensor.cpp
+++ b/kbdsensor.cpp
@@ -36,6 +36,7 @@ struct KbdSensorKeys {
3636 { "AT Translated Set 2 keyboard", { EV_KEY, KEY_F5, KEY_F8, KEY_F6, KEY_F7, KEY_LEFTALT, KEY_LEFTCTRL, 1 } },
3737 { "AT Translated Set 2 keyboard", { EV_KEY, KEY_F9, KEY_F12, KEY_F10, KEY_F11, KEY_LEFTALT, KEY_LEFTCTRL, 1 } },
3838 { "Asus Laptop extra buttons", { EV_KEY, KEY_F9, KEY_F12, KEY_F10, KEY_F11, KEY_LEFTALT, KEY_LEFTCTRL, 2 } },
39+ { "HP WMI hotkeys", { -1, 0, 0, 0, 0, 0, 0, 3 } },
3940 };
4041
4142 const int ID_ACCELERATION = (SENSORS_HANDLE_BASE + 0);
@@ -242,6 +243,18 @@ int SensorPollContext::doPoll(sensors_event_t *data, int count)
242243 if (enabled && count > 0)
243244 break;
244245 }
246+ } else if (iev.type == EV_KEY && iev.code == KEY_DIRECTION && iev.value) {
247+ if (rotation == ROT_270)
248+ rotation = ROT_0;
249+ else
250+ rotation++;
251+ break;
252+ } else if (iev.type == EV_SW && iev.code == SW_TABLET_MODE) {
253+ if (!iev.value)
254+ rotation = ROT_0;
255+ else if (rotation == ROT_0)
256+ rotation = ROT_90;
257+ break;
245258 }
246259 }
247260
Afficher sur ancien navigateur de dépôt.