• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

frameworks/base


Commit MetaInfo

Revisão0184443e1914676436148cea584823e2f260c14e (tree)
Hora2011-08-05 17:26:23
AutorChih-Wei Huang <cwhuang@linu...>
CommiterChih-Wei Huang

Mensagem de Log

Add keycodes F1 - F12

With these keycodes we are able to support PC keyboards.

Change-Id: Ia6f6ac93c7bfbe89a0017875d52844676c2b1b33
Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>

Mudança Sumário

Diff

--- a/api/current.xml
+++ b/api/current.xml
@@ -180799,6 +180799,138 @@
180799180799 visibility="public"
180800180800 >
180801180801 </field>
180802+<field name="KEYCODE_F1"
180803+ type="int"
180804+ transient="false"
180805+ volatile="false"
180806+ value="111"
180807+ static="true"
180808+ final="true"
180809+ deprecated="not deprecated"
180810+ visibility="public"
180811+>
180812+</field>
180813+<field name="KEYCODE_F10"
180814+ type="int"
180815+ transient="false"
180816+ volatile="false"
180817+ value="120"
180818+ static="true"
180819+ final="true"
180820+ deprecated="not deprecated"
180821+ visibility="public"
180822+>
180823+</field>
180824+<field name="KEYCODE_F11"
180825+ type="int"
180826+ transient="false"
180827+ volatile="false"
180828+ value="121"
180829+ static="true"
180830+ final="true"
180831+ deprecated="not deprecated"
180832+ visibility="public"
180833+>
180834+</field>
180835+<field name="KEYCODE_F12"
180836+ type="int"
180837+ transient="false"
180838+ volatile="false"
180839+ value="122"
180840+ static="true"
180841+ final="true"
180842+ deprecated="not deprecated"
180843+ visibility="public"
180844+>
180845+</field>
180846+<field name="KEYCODE_F2"
180847+ type="int"
180848+ transient="false"
180849+ volatile="false"
180850+ value="112"
180851+ static="true"
180852+ final="true"
180853+ deprecated="not deprecated"
180854+ visibility="public"
180855+>
180856+</field>
180857+<field name="KEYCODE_F3"
180858+ type="int"
180859+ transient="false"
180860+ volatile="false"
180861+ value="113"
180862+ static="true"
180863+ final="true"
180864+ deprecated="not deprecated"
180865+ visibility="public"
180866+>
180867+</field>
180868+<field name="KEYCODE_F4"
180869+ type="int"
180870+ transient="false"
180871+ volatile="false"
180872+ value="114"
180873+ static="true"
180874+ final="true"
180875+ deprecated="not deprecated"
180876+ visibility="public"
180877+>
180878+</field>
180879+<field name="KEYCODE_F5"
180880+ type="int"
180881+ transient="false"
180882+ volatile="false"
180883+ value="115"
180884+ static="true"
180885+ final="true"
180886+ deprecated="not deprecated"
180887+ visibility="public"
180888+>
180889+</field>
180890+<field name="KEYCODE_F6"
180891+ type="int"
180892+ transient="false"
180893+ volatile="false"
180894+ value="116"
180895+ static="true"
180896+ final="true"
180897+ deprecated="not deprecated"
180898+ visibility="public"
180899+>
180900+</field>
180901+<field name="KEYCODE_F7"
180902+ type="int"
180903+ transient="false"
180904+ volatile="false"
180905+ value="117"
180906+ static="true"
180907+ final="true"
180908+ deprecated="not deprecated"
180909+ visibility="public"
180910+>
180911+</field>
180912+<field name="KEYCODE_F8"
180913+ type="int"
180914+ transient="false"
180915+ volatile="false"
180916+ value="118"
180917+ static="true"
180918+ final="true"
180919+ deprecated="not deprecated"
180920+ visibility="public"
180921+>
180922+</field>
180923+<field name="KEYCODE_F9"
180924+ type="int"
180925+ transient="false"
180926+ volatile="false"
180927+ value="119"
180928+ static="true"
180929+ final="true"
180930+ deprecated="not deprecated"
180931+ visibility="public"
180932+>
180933+</field>
180802180934 <field name="KEYCODE_FOCUS"
180803180935 type="int"
180804180936 transient="false"
--- a/core/java/android/view/KeyEvent.java
+++ b/core/java/android/view/KeyEvent.java
@@ -331,6 +331,30 @@ public class KeyEvent extends InputEvent implements Parcelable {
331331 /** Key code constant: Mode Button key.
332332 * On a game controller, the button labeled Mode. */
333333 public static final int KEYCODE_BUTTON_MODE = 110;
334+ /** Key code constant: F1 key. */
335+ public static final int KEYCODE_F1 = 111;
336+ /** Key code constant: F2 key. */
337+ public static final int KEYCODE_F2 = 112;
338+ /** Key code constant: F3 key. */
339+ public static final int KEYCODE_F3 = 113;
340+ /** Key code constant: F4 key. */
341+ public static final int KEYCODE_F4 = 114;
342+ /** Key code constant: F5 key. */
343+ public static final int KEYCODE_F5 = 115;
344+ /** Key code constant: F6 key. */
345+ public static final int KEYCODE_F6 = 116;
346+ /** Key code constant: F7 key. */
347+ public static final int KEYCODE_F7 = 117;
348+ /** Key code constant: F8 key. */
349+ public static final int KEYCODE_F8 = 118;
350+ /** Key code constant: F9 key. */
351+ public static final int KEYCODE_F9 = 119;
352+ /** Key code constant: F10 key. */
353+ public static final int KEYCODE_F10 = 120;
354+ /** Key code constant: F11 key. */
355+ public static final int KEYCODE_F11 = 121;
356+ /** Key code constant: F12 key. */
357+ public static final int KEYCODE_F12 = 122;
334358
335359 // NOTE: If you add a new keycode here you must also add it to:
336360 // isSystem()
@@ -348,7 +372,7 @@ public class KeyEvent extends InputEvent implements Parcelable {
348372 // those new codes. This is intended to maintain a consistent
349373 // set of key code definitions across all Android devices.
350374
351- private static final int LAST_KEYCODE = KEYCODE_BUTTON_MODE;
375+ private static final int LAST_KEYCODE = KEYCODE_F12;
352376
353377 /**
354378 * @deprecated There are now more than MAX_KEYCODE keycodes.
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -953,6 +953,18 @@
953953 <enum name="KEYCODE_BUTTON_START" value="108" />
954954 <enum name="KEYCODE_BUTTON_SELECT" value="109" />
955955 <enum name="KEYCODE_BUTTON_MODE" value="110" />
956+ <enum name="KEYCODE_F1" value="111" />
957+ <enum name="KEYCODE_F2" value="112" />
958+ <enum name="KEYCODE_F3" value="113" />
959+ <enum name="KEYCODE_F4" value="114" />
960+ <enum name="KEYCODE_F5" value="115" />
961+ <enum name="KEYCODE_F6" value="116" />
962+ <enum name="KEYCODE_F7" value="117" />
963+ <enum name="KEYCODE_F8" value="118" />
964+ <enum name="KEYCODE_F9" value="119" />
965+ <enum name="KEYCODE_F10" value="120" />
966+ <enum name="KEYCODE_F11" value="121" />
967+ <enum name="KEYCODE_F12" value="122" />
956968 </attr>
957969
958970 <!-- ***************************************************************** -->
--- a/include/ui/KeycodeLabels.h
+++ b/include/ui/KeycodeLabels.h
@@ -135,6 +135,18 @@ static const KeycodeLabel KEYCODES[] = {
135135 { "BUTTON_START", 108 },
136136 { "BUTTON_SELECT", 109 },
137137 { "BUTTON_MODE", 110 },
138+ { "F1", 111 },
139+ { "F2", 112 },
140+ { "F3", 113 },
141+ { "F4", 114 },
142+ { "F5", 115 },
143+ { "F6", 116 },
144+ { "F7", 117 },
145+ { "F8", 118 },
146+ { "F9", 119 },
147+ { "F10", 120 },
148+ { "F11", 121 },
149+ { "F12", 122 },
138150
139151 // NOTE: If you add a new keycode here you must also add it to several other files.
140152 // Refer to frameworks/base/core/java/android/view/KeyEvent.java for the full list.
--- a/native/include/android/keycodes.h
+++ b/native/include/android/keycodes.h
@@ -154,6 +154,18 @@ enum {
154154 AKEYCODE_BUTTON_START = 108,
155155 AKEYCODE_BUTTON_SELECT = 109,
156156 AKEYCODE_BUTTON_MODE = 110,
157+ AKEYCODE_F1 = 111,
158+ AKEYCODE_F2 = 112,
159+ AKEYCODE_F3 = 113,
160+ AKEYCODE_F4 = 114,
161+ AKEYCODE_F5 = 115,
162+ AKEYCODE_F6 = 116,
163+ AKEYCODE_F7 = 117,
164+ AKEYCODE_F8 = 118,
165+ AKEYCODE_F9 = 119,
166+ AKEYCODE_F10 = 120,
167+ AKEYCODE_F11 = 121,
168+ AKEYCODE_F12 = 122,
157169
158170 // NOTE: If you add a new keycode here you must also add it to several other files.
159171 // Refer to frameworks/base/core/java/android/view/KeyEvent.java for the full list.