Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Implement additional keycodes

Adds keys for

*) WLAN, Bluetooth, touchpad toggle,
*) brightness down, up, auto and
*) screenshot

as found on docks of current Asus Transformer devices.

Change-Id: I94a5a4e80e5de85db49a1044c7dcb9ef28db075c
  • Loading branch information...
commit 70c7bd81dd33beb5c0e9aa0ae61d19ed319228c4 1 parent 75b2e6d
Alexander Hofbauer authored April 10, 2012
7  api/current.txt
@@ -22208,6 +22208,9 @@ package android.view {
22208 22208
     field public static final int KEYCODE_BACKSLASH = 73; // 0x49
22209 22209
     field public static final int KEYCODE_BOOKMARK = 174; // 0xae
22210 22210
     field public static final int KEYCODE_BREAK = 121; // 0x79
  22211
+    field public static final int KEYCODE_BRIGHTNESS_AUTO = 216; // 0xd8
  22212
+    field public static final int KEYCODE_BRIGHTNESS_DOWN = 214; // 0xd6
  22213
+    field public static final int KEYCODE_BRIGHTNESS_UP = 215; // 0xd7
22211 22214
     field public static final int KEYCODE_BUTTON_1 = 188; // 0xbc
22212 22215
     field public static final int KEYCODE_BUTTON_10 = 197; // 0xc5
22213 22216
     field public static final int KEYCODE_BUTTON_11 = 198; // 0xc6
@@ -22361,6 +22364,7 @@ package android.view {
22361 22364
     field public static final int KEYCODE_R = 46; // 0x2e
22362 22365
     field public static final int KEYCODE_RIGHT_BRACKET = 72; // 0x48
22363 22366
     field public static final int KEYCODE_S = 47; // 0x2f
  22367
+    field public static final int KEYCODE_SCREENSHOT = 217; // 0xd9
22364 22368
     field public static final int KEYCODE_SCROLL_LOCK = 116; // 0x74
22365 22369
     field public static final int KEYCODE_SEARCH = 84; // 0x54
22366 22370
     field public static final int KEYCODE_SEMICOLON = 74; // 0x4a
@@ -22379,6 +22383,9 @@ package android.view {
22379 22383
     field public static final int KEYCODE_SYSRQ = 120; // 0x78
22380 22384
     field public static final int KEYCODE_T = 48; // 0x30
22381 22385
     field public static final int KEYCODE_TAB = 61; // 0x3d
  22386
+    field public static final int KEYCODE_TOGGLE_BT = 212; // 0xd4
  22387
+    field public static final int KEYCODE_TOGGLE_TOUCHPAD = 213; // 0xd5
  22388
+    field public static final int KEYCODE_TOGGLE_WIFI = 211; // 0xd3
22382 22389
     field public static final int KEYCODE_TV = 170; // 0xaa
22383 22390
     field public static final int KEYCODE_TV_INPUT = 178; // 0xb2
22384 22391
     field public static final int KEYCODE_TV_POWER = 177; // 0xb1
17  core/java/android/view/KeyEvent.java
@@ -592,7 +592,15 @@
592 592
      * Used to launch a calculator application. */
593 593
     public static final int KEYCODE_CALCULATOR      = 210;
594 594
 
595  
-    private static final int LAST_KEYCODE           = KEYCODE_CALCULATOR;
  595
+    public static final int KEYCODE_TOGGLE_WIFI     = 211;
  596
+    public static final int KEYCODE_TOGGLE_BT       = 212;
  597
+    public static final int KEYCODE_TOGGLE_TOUCHPAD = 213;
  598
+    public static final int KEYCODE_BRIGHTNESS_DOWN = 214;
  599
+    public static final int KEYCODE_BRIGHTNESS_UP   = 215;
  600
+    public static final int KEYCODE_BRIGHTNESS_AUTO = 216;
  601
+    public static final int KEYCODE_SCREENSHOT      = 217;
  602
+
  603
+    private static final int LAST_KEYCODE           = KEYCODE_SCREENSHOT;
596 604
 
597 605
     // NOTE: If you add a new keycode here you must also add it to:
598 606
     //  isSystem()
@@ -825,6 +833,13 @@ private static void populateKeycodeSymbolicNames() {
825 833
         names.append(KEYCODE_CALENDAR, "KEYCODE_CALENDAR");
826 834
         names.append(KEYCODE_MUSIC, "KEYCODE_MUSIC");
827 835
         names.append(KEYCODE_CALCULATOR, "KEYCODE_CALCULATOR");
  836
+        names.append(KEYCODE_TOGGLE_WIFI, "KEYCODE_TOGGLE_WIFI");
  837
+        names.append(KEYCODE_TOGGLE_BT, "KEYCODE_TOGGLE_BT");
  838
+        names.append(KEYCODE_TOGGLE_TOUCHPAD, "KEYCODE_TOGGLE_TOUCHPAD");
  839
+        names.append(KEYCODE_BRIGHTNESS_DOWN, "KEYCODE_BRIGHTNESS_DOWN");
  840
+        names.append(KEYCODE_BRIGHTNESS_UP, "KEYCODE_BRIGHTNESS_UP");
  841
+        names.append(KEYCODE_BRIGHTNESS_AUTO, "KEYCODE_BRIGHTNESS_AUTO");
  842
+        names.append(KEYCODE_SCREENSHOT, "KEYCODE_SCREENSHOT");
828 843
     };
829 844
 
830 845
     // Symbolic names of all metakeys in bit order from least significant to most significant.
7  core/res/res/values/attrs.xml
@@ -1497,6 +1497,13 @@
1497 1497
         <enum name="KEYCODE_CALENDAR" value="208" />
1498 1498
         <enum name="KEYCODE_MUSIC" value="209" />
1499 1499
         <enum name="KEYCODE_CALCULATOR" value="210" />
  1500
+        <enum name="KEYCODE_TOGGLE_WIFI" value="211" />
  1501
+        <enum name="KEYCODE_TOGGLE_BT" value="212" />
  1502
+        <enum name="KEYCODE_TOGGLE_TOUCHPAD" value="213" />
  1503
+        <enum name="KEYCODE_BRIGHTNESS_DOWN" value="214" />
  1504
+        <enum name="KEYCODE_BRIGHTNESS_UP" value="215" />
  1505
+        <enum name="KEYCODE_BRIGHTNESS_AUTO" value="216" />
  1506
+        <enum name="KEYCODE_SCREENSHOT" value="217" />
1500 1507
     </attr>
1501 1508
 
1502 1509
     <!-- ***************************************************************** -->
7  include/ui/KeycodeLabels.h
@@ -235,6 +235,13 @@ static const KeycodeLabel KEYCODES[] = {
235 235
     { "CALENDAR", 208 },
236 236
     { "MUSIC", 209 },
237 237
     { "CALCULATOR", 210 },
  238
+    { "TOGGLE_WIFI", 211 },
  239
+    { "TOGGLE_BT", 212 },
  240
+    { "TOGGLE_TOUCHPAD", 213 },
  241
+    { "BRIGHTNESS_DOWN", 214 },
  242
+    { "BRIGHTNESS_UP", 215 },
  243
+    { "BRIGHTNESS_AUTO", 216 },
  244
+    { "SCREENSHOT", 217 },
238 245
 
239 246
     // NOTE: If you add a new keycode here you must also add it to several other files.
240 247
     //       Refer to frameworks/base/core/java/android/view/KeyEvent.java for the full list.
7  native/include/android/keycodes.h
@@ -254,6 +254,13 @@ enum {
254 254
     AKEYCODE_CALENDAR        = 208,
255 255
     AKEYCODE_MUSIC           = 209,
256 256
     AKEYCODE_CALCULATOR      = 210,
  257
+    AKEYCODE_TOGGLE_WIFI     = 211,
  258
+    AKEYCODE_TOGGLE_BT       = 212,
  259
+    AKEYCODE_TOGGLE_TOUCHPAD = 213,
  260
+    AKEYCODE_BRIGHTNESS_DOWN = 214,
  261
+    AKEYCODE_BRIGHTNESS_UP   = 215,
  262
+    AKEYCODE_BRIGHTNESS_AUTO = 216,
  263
+    AKEYCODE_SCREENSHOT      = 217,
257 264
 
258 265
     // NOTE: If you add a new keycode here you must also add it to several other files.
259 266
     //       Refer to frameworks/base/core/java/android/view/KeyEvent.java for the full list.

Git Notes

review

Code-Review+2: Steve Kondik <shade@chemlab.org>
Verified+1: Steve Kondik <shade@chemlab.org>
Submitted-by: Steve Kondik <shade@chemlab.org>
Submitted-at: Sat, 05 May 2012 14:31:58 +0400
Reviewed-on: http://review.cyanogenmod.com/14670
Project: CyanogenMod/android_frameworks_base
Branch: refs/heads/ics

0 notes on commit 70c7bd8

Please sign in to comment.
Something went wrong with that request. Please try again.