Android教程網
  1. 首頁
  2. Android 技術
  3. Android 手機
  4. Android 系統教程
  5. Android 游戲
 Android教程網 >> Android技術 >> Android開發 >> 初級開發 >> Android按鍵事件映射表和轉義符對照

Android按鍵事件映射表和轉義符對照

編輯:初級開發

 很多開發者表示不知道如何在Android的layout布局文件中輸入類似&這樣的符號,下面android123整理了下一些案件事件映射和轉義符對照表,比如說 & 在layout.XML中應該\uff06同時,從下表可以看到&和7在鍵盤上是同一個位置。

KeyEvent.KEYCODE_UNKNOWN,
            KeyEvent.KEYCODE_SOFT_LEFT,
            KeyEvent.KEYCODE_SOFT_RIGHT,
            KeyEvent.KEYCODE_HOME,
            KeyEvent.KEYCODE_BACK,
            KeyEvent.KEYCODE_CALL,
            KeyEvent.KEYCODE_ENDCALL,
            KeyEvent.KEYCODE_0 | ('\uff09' << SHIFT_FWCH), // )
            KeyEvent.KEYCODE_1 | ('\uff01' << SHIFT_FWCH), // !
            KeyEvent.KEYCODE_2 | ('\uff20' << SHIFT_FWCH), // @
            KeyEvent.KEYCODE_3 | ('\uff03' << SHIFT_FWCH), // #
            KeyEvent.KEYCODE_4 | ('\uffe5' << SHIFT_FWCH), // $ - fullwidth Yuan
            KeyEvent.KEYCODE_5 | ('\uff05' << SHIFT_FWCH), // %
            KeyEvent.KEYCODE_6 | ('\u2026' << SHIFT_FWCH), // ^ - Apostrophe
            KeyEvent.KEYCODE_7 | ('\uff06' << SHIFT_FWCH), // &
            KeyEvent.KEYCODE_8 | ('\uff0a' << SHIFT_FWCH), // *
            KeyEvent.KEYCODE_9 | ('\uff08' << SHIFT_FWCH), // (
            KeyEvent.KEYCODE_STAR,
            KeyEvent.KEYCODE_POUND,
            KeyEvent.KEYCODE_DPAD_UP,
            KeyEvent.KEYCODE_DPAD_DOWN,
            KeyEvent.KEYCODE_DPAD_LEFT,
            KeyEvent.KEYCODE_DPAD_RIGHT,
            KeyEvent.KEYCODE_DPAD_CENTER,
            KeyEvent.KEYCODE_VOLUME_UP,
            KeyEvent.KEYCODE_VOLUME_DOWN,
            KeyEvent.KEYCODE_POWER,
            KeyEvent.KEYCODE_CAMERA,
            KeyEvent.KEYCODE_CLEAR,
            KeyEvent.KEYCODE_A,
            KeyEvent.KEYCODE_B | ('\uff3d' << SHIFT_FWCH), // ]
            KeyEvent.KEYCODE_C | ('\u00a9' << SHIFT_FWCH), // copyright
            KeyEvent.KEYCODE_D | ('\u3001' << SHIFT_FWCH), // \\
            KeyEvent.KEYCODE_E | ('_' << SHIFT_FWCH), // _
            KeyEvent.KEYCODE_F | ('\uff5b' << SHIFT_FWCH), // {
            KeyEvent.KEYCODE_G | ('\uff5d' << SHIFT_FWCH), // }
            KeyEvent.KEYCODE_H | ('\uff1a' << SHIFT_FWCH), // :
            KeyEvent.KEYCODE_I | ('\uff0d' << SHIFT_FWCH), // -
            KeyEvent.KEYCODE_J | ('\uff1b' << SHIFT_FWCH), // ;
            KeyEvent.KEYCODE_K | ('\u201c' << SHIFT_FWCH), // "
            KeyEvent.KEYCODE_L | ('\u2019' << SHIFT_FWCH), // '
            KeyEvent.KEYCODE_M | ('\u300b' << SHIFT_FWCH), // > - French quotes
            KeyEvent.KEYCODE_N | ('\u300a' << SHIFT_FWCH), // < - French quotes
            KeyEvent.KEYCODE_O | ('\uff0b' << SHIFT_FWCH), // +
            KeyEvent.KEYCODE_P | ('\uff1d' << SHIFT_FWCH), // =
            KeyEvent.KEYCODE_Q | ('\t' << SHIFT_FWCH), // \t
            KeyEvent.KEYCODE_R | ('\u00ae' << SHIFT_FWCH), // trademark
            KeyEvent.KEYCODE_S | ('\uff5c' << SHIFT_FWCH), // |
            KeyEvent.KEYCODE_T | ('\u20ac' << SHIFT_FWCH), //
            KeyEvent.KEYCODE_U | ('\u00d7' << SHIFT_FWCH), // multiplIEr
            KeyEvent.KEYCODE_V | ('\uff3b' << SHIFT_FWCH), // [
            KeyEvent.KEYCODE_W | ('\uff40' << SHIFT_FWCH), // `
            KeyEvent.KEYCODE_X, KeyEvent.KEYCODE_Y | ('\u00f7' << SHIFT_FWCH),
            KeyEvent.KEYCODE_Z,
            KeyEvent.KEYCODE_COMMA | ('\uff1f' << SHIFT_FWCH),
            KeyEvent.KEYCODE_PERIOD | ('\uff0f' << SHIFT_FWCH),
            KeyEvent.KEYCODE_ALT_LEFT, KeyEvent.KEYCODE_ALT_RIGHT,
            KeyEvent.KEYCODE_SHIFT_LEFT, KeyEvent.KEYCODE_SHIFT_RIGHT,
            KeyEvent.KEYCODE_TAB, KeyEvent.KEYCODE_SPACE, KeyEvent.KEYCODE_SYM,
            KeyEvent.KEYCODE_EXPLORER, KeyEvent.KEYCODE_ENVELOPE,
            KeyEvent.KEYCODE_ENTER, KeyEvent.KEYCODE_DEL,
            KeyEvent.KEYCODE_GRAVE, KeyEvent.KEYCODE_MINUS,
            KeyEvent.KEYCODE_EQUALS, KeyEvent.KEYCODE_LEFT_BRACKET,
            KeyEvent.KEYCODE_RIGHT_BRACKET, KeyEvent.KEYCODE_BACKSLASH,
            KeyEvent.KEYCODE_SEMICOLON, KeyEvent.KEYCODE_APOSTROPHE,
            KeyEvent.KEYCODE_SLASH,
            KeyEvent.KEYCODE_AT | ('\uff5e' << SHIFT_FWCH),
            KeyEvent.KEYCODE_NUM, KeyEvent.KEYCODE_HEADSETHOOK,
            KeyEvent.KEYCODE_FOCUS, KeyEvent.KEYCODE_PLUS,
            KeyEvent.KEYCODE_MENU, KeyEvent.KEYCODE_NOTIFICATION,
            KeyEvent.KEYCODE_SEARCH

  1. 上一頁:
  2. 下一頁:
熱門文章
閱讀排行版
Copyright © Android教程網 All Rights Reserved