OSDN Git Service

support rotation keys configuration honeycomb-x86
authorChih-Wei Huang <cwhuang@linux.org.tw>
Sun, 13 Nov 2011 07:25:02 +0000 (15:25 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Sun, 13 Nov 2011 07:25:02 +0000 (15:25 +0800)
Android.mk
kbdsensor.cpp

index 63982b6..20ea503 100644 (file)
@@ -13,5 +13,13 @@ LOCAL_MODULE_TAGS := optional
 
 ifeq ($(strip $(BOARD_USES_KBDSENSOR)),true)
 LOCAL_SRC_FILES := kbdsensor.cpp
+
+ifeq ($(strip $(BOARD_USES_KBDSENSOR_ROTKEY1)),true)
+LOCAL_CFLAGS := -DFN_ROT_0=KEY_F9 -DFN_ROT_90=KEY_F12 -DFN_ROT_180=KEY_F10 -DFN_ROT_270=KEY_F11
+endif
+ifeq ($(filter -DFN_ROT_0=%,$(LOCAL_CFLAGS)),)
+LOCAL_CFLAGS := -DFN_ROT_0=KEY_UP -DFN_ROT_90=KEY_RIGHT -DFN_ROT_180=KEY_DOWN -DFN_ROT_270=KEY_LEFT
+endif
+
 include $(BUILD_SHARED_LIBRARY)
 endif
index ad23f66..34fc9cd 100644 (file)
@@ -209,16 +209,16 @@ int SensorPollContext::poll_poll(struct sensors_poll_device_t *dev, sensors_even
                                                continue;
                                        rot = ctx->rotation;
                                        break;
-                               case KEY_UP:
+                               case FN_ROT_0:
                                        rot = ROT_0;
                                        break;
-                               case KEY_RIGHT:
+                               case FN_ROT_90:
                                        rot = ROT_90;
                                        break;
-                               case KEY_DOWN:
+                               case FN_ROT_180:
                                        rot = ROT_180;
                                        break;
-                               case KEY_LEFT:
+                               case FN_ROT_270:
                                        rot = ROT_270;
                                        break;
 #if 0