Android 键盘键名和键值列表
- 格式:docx
- 大小:25.35 KB
- 文档页数:8
Android⼿机常⽤的三个键,home键,back键及menu键。
public class BackKeyTest extends Activity{/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState){super.onCreate(savedInstanceState);setContentView(yout.main);}@Overridepublic boolean onKeyDown(int keyCode, KeyEvent event){if (keyCode == KeyEvent.KEYCODE_BACK ){// 创建退出对话框AlertDialog isExit = new AlertDialog.Builder(this).create();// 设置对话框标题isExit.setTitle("系统提⽰");// 设置对话框消息isExit.setMessage("确定要退出吗");// 添加选择按钮并注册监听isExit.setButton("确定", listener);isExit.setButton2("取消", listener);// 显⽰对话框isExit.show();}return false;}/**监听对话框⾥⾯的button点击事件*/DialogInterface.OnClickListener listener = new DialogInterface.OnClickListener(){public void onClick(DialogInterface dialog, int which){switch (which){case AlertDialog.BUTTON_POSITIVE:// "确认"按钮退出程序finish();break;case AlertDialog.BUTTON_NEGATIVE:// "取消"第⼆个按钮取消对话框break;default:break;}}};}⼩结:Android⼿机常⽤的三个键,home键,back键及menu键。
安卓键盘键值对照表Android 键盘Key值对照表键码常数值描述vbKeyLButton 1 鼠标左键vbKeyRButton 2 鼠标右键vbKeyCancel 3 CANCEL 键vbKeyMButton 4 鼠标中键vbKeyBack 8 BACKSPACE 键vbKeyTab 9 TAB 键vbKeyClear 12 CLEAR 键vbKeyReturn 13 ENTER 键vbKeyShift 16 SHIFT 键vbKeyControl 17 CTRL 键vbKeyMenu 18 菜单键vbKeyPause 19 PAUSE 键vbKeyCapital 20 CAPS LOCK 键vbKeyEscape 27 ESC 键vbKeySpace 32 SPACEBAR 键vbKeyPageUp 33 PAGEUP 键vbKeyPageDown 34 PAGEDOWN 键vbKeyEnd 35 END 键vbKeyHome 36 HOME 键vbKeyLeft 37 LEFT ARROW 键vbKeyUp 38 UP ARROW 键vbKeyRight 39 RIGHT ARROW 键vbKeyDown 40 DOWN ARROW 键vbKeySelect 41 SELECT 键vbKeyPrint 42 PRINT SCREEN 键vbKeyExecute 43 EXECUTE 键vbKeySnapshot 44 SNAP SHOT 键vbKeyInser 45 INS 键vbKeyDelete 46 DEL 键vbKeyHelp 47 HELP 键vbKeyNumlock 144 NUM LOCK 键A 键到Z 键与其ASCII 码的相应值'A ' 到'Z ' 是一致的常数值描述vbKeyA 65 A 键vbKeyB 66 B 键vbKeyC 67 C 键vbKeyD 68 D 键vbKeyE 69 E 键vbKeyF 70 F 键vbKeyG 71 G 键vbKeyH 72 H 键vbKeyI 73 I 键vbKeyJ 74 J 键vbKeyK 75 K 键vbKeyL 76 L 键vbKeyM 77 M 键vbKeyN 78 N 键vbKeyO 79 O 键vbKeyP 80 P 键vbKeyQ 81 Q 键vbKeyR 82 R 键vbKeyS 83 S 键vbKeyT 84 T 键vbKeyU 85 U 键vbKeyV 86 V 键vbKeyW 87 W 键vbKeyX 88 X 键vbKeyY 89 Y 键vbKeyZ 90 Z 键0 键到9 键与其ASCII 码的相应值'0 ' 到'9 ' 是一致的常数值描述vbKey0 48 0 键vbKey1 49 1 键vbKey2 50 2 键vbKey3 51 3 键vbKey4 52 4 键vbKey5 53 5 键vbKey6 54 6 键vbKey7 55 7 键vbKey8 56 8 键vbKey9 57 9 键数字小键盘上的键常数值描述vbKeyNumpad0 96 0 键vbKeyNumpad1 97 1 键vbKeyNumpad2 98 2 键vbKeyNumpad3 99 3 键vbKeyNumpad4 100 4 键vbKeyNumpad5 101 5 键vbKeyNumpad6 102 6 键vbKeyNumpad7 103 7 键vbKeyNumpad8 104 8 键vbKeyNumpad9 105 9 键vbKeyMultiply 106 乘号(*) 键vbKeyAdd 107 加号(+) 键vbKeySeparator 108 ENTER 键(在数字小键盘上)vbKeySubtract 109 减号(-) 键vbKeyDecimal 110 小数点(.) 键vbKeyDivide 111 除号(/) 键功能键常数值描述vbKeyF1 112 F1 键vbKeyF2 113 F2 键vbKeyF3 114 F3 键vbKeyF4 115 F4 键vbKeyF5 116 F5 键vbKeyF6 117 F6 键vbKeyF7 118 F7 键vbKeyF8 119 F8 键vbKeyF9 120 F9 键vbKeyF10 121 F10 键vbKeyF11 122 F11 键vbKeyF12 123 F12 键vbKeyF13 124 F13 键vbKeyF14 125 F14 键vbKeyF15 126 F15 键vbKeyF16 127 F16 键。
存盘 Ctrl+s(肯定知道)注释代码 Ctrl+/取消注释 Ctrl+\(Eclipse3已经都合并到Ctrl+/了)代码辅助 Alt+/快速修复 Ctrl+1代码格式化 Ctrl+Shift+f整理导入 Ctrl+Shift+o切换窗口 Ctrl+f6<可改为ctrl+tab方便>ctrl+shift+M 导入未引用的包ctrl+w 关闭单个窗口F3 跳转到类、变量的声明F11 运行上次程序Ctrl + F11 调试上次程序Alt + 回下一个编辑点ctrl+shift+T 查找工程中的类最经典的快捷键Ctrl+1 快速修复(最经典的快捷键,就不用多说了)Ctrl+D: 删除当前行Ctrl+Alt+↓复制当前行到下一行(复制增加)Ctrl+Alt+↑复制当前行到上一行(复制增加)Alt+↓当前行和下面一行交互位置(特别实用,可以省去先剪切,再粘贴了)Alt+↑当前行和上面一行交互位置(同上)Alt+←前一个编辑的页面Alt+→下一个编辑的页面(当然是针对上面那条来说了)Alt+Enter 显示当前选择资源(工程,or 文件 or文件)的属性Shift+Enter 在当前行的下一行插入空行(这时鼠标可以在当前行的任一位置,不一定是最后)Shift+Ctrl+Enter 在当前行插入空行(原理同上条)Ctrl+Q 定位到最后编辑的地方Ctrl+L 定位在某行 (对于程序超过100的人就有福音了)Ctrl+M 最大化当前的Edit或View (再按则反之)Ctrl+/ 注释当前行,再按则取消注释Ctrl+O 快速显示 OutLineCtrl+T 快速显示当前类的继承结构Ctrl+W 关闭当前EditerCtrl+K 参照选中的Word快速定位到下一个Ctrl+E 快速显示当前Editer的下拉列表(如果当前页面没有显示的用黑体表示)Ctrl+/(小键盘) 折叠当前类中的所有代码Ctrl+×(小键盘) 展开当前类中的所有代码Ctrl+Space 代码助手完成一些代码的插入(但一般和输入法有冲突,可以修改输入法的热键,也可以暂用Alt+/来代替)Ctrl+Shift+E 显示管理当前打开的所有的View的管理器(可以选择关闭,激活等操作)Ctrl+J 正向增量查找(按下Ctrl+J后,你所输入的每个字母编辑器都提供快速匹配定位到某个单词,如果没有,则在stutes line中显示没有找到了,查一个单词时,特别实用,这个功能Idea两年前就有了)Ctrl+Shift+J 反向增量查找(和上条相同,只不过是从后往前查)Ctrl+Shift+F4 关闭所有打开的EditerCtrl+Shift+X 把当前选中的文本全部变为大写Ctrl+Shift+Y 把当前选中的文本全部变为小写Ctrl+Shift+F 格式化当前代码Ctrl+Shift+P 定位到对于的匹配符(譬如{}) (从前面定位后面时,光标要在匹配符里面,后面到前面,则反之)下面的快捷键是重构里面常用的,本人就自己喜欢且常用的整理一下(注:一般重构的快捷键都是Alt+Shift开头的了)Alt+Shift+R 重命名 (是我自己最爱用的一个了,尤其是变量和类的Rename,比手工方法能节省很多劳动力)Alt+Shift+M 抽取方法 (这是重构里面最常用的方法之一了,尤其是对一大堆泥团代码有用)Alt+Shift+C 修改函数结构(比较实用,有N个函数调用了这个方法,修改一次搞定)Alt+Shift+L 抽取本地变量( 可以直接把一些魔法数字和字符串抽取成一个变量,尤其是多处调用的时候)Alt+Shift+F 把Class中的local变量变为field变量 (比较实用的功能)Alt+Shift+I 合并变量(可能这样说有点不妥Inline)Alt+Shift+V 移动函数和变量(不怎么常用)Alt+Shift+Z 重构的后悔药(Undo)Alt+左箭头,右箭头以在编辑窗口切换标签Alt+上下箭头, 以自动选择鼠标所在行,并将其上下移动Ctrl+f6 可以弹出菜单,上面列出可以切换的编辑窗口,这样不用鼠标也可切换Ctrl+f7 可以在视图之间切换 ,如编辑视图,输出视图,工程视图Ctrl+f8 可以在不同的观察视图中切换,就是在java视图,调试视图,等之间切换Ctrl+m 可以在最大化当前窗口和还原当前窗口之间切换Ctrl+e 弹出输入窗口,可以输入你想要编辑的代码窗口,和Ctrl+f6的功能相同,只不过一个是选择的方式,一个是输入的方式,切换窗口Ctrl+T 可以直接显示光标所在内容的类图,可以直接输入,并跳到输入内容部分按住Ctrl键,然后鼠标指向变量名,方法名,类名在源代码中快速跳转Ctrl + F11 快速执行程序Ctrl+Shift+F 程序代码自动排版Ctrl+Shift+O 自动加入引用。
AndroidStudio快捷键⼤全Android Studio快捷键⼤全1. Ctrl+D:集合了复制和粘贴两个操作,如果有选中的部分就复制选中的部分,并在选中部分的后⾯粘贴出来,如果没有选中的部分,就复制光标所在的⾏,并在此⾏的下⾯粘贴出来。
2. Ctrl+空格:输⼊代码时按此组合键会列出与之相匹配的类、⽅法名、成员变量等,起智能提⽰的作⽤。
在编辑XML⽂件⼀样有⽤。
3. Ctrl+向下箭头或Ctrl+向上箭头:在有⾃动匹配下拉列表时,此快捷键会⾃动关掉下拉列表,光标移动到下/上⼀⾏。
4. ⾃动匹配下拉列表的排列⽅式的切换:在⾃动匹配下拉列表的右下⾓有个“π”图标,点击后可选是按:实⽤性、字母两种排列⽅式。
5. Ctrl+斜杠、Ctrl+shift+斜杠:Ctrl+斜杠:注释或取消注释当前⾏或选中的代码块,以双斜杠的⽅式即“//”Ctrl+shift+斜杠:注释或取消注释选中的代码块,以“/*……*/”⽅式注释,6. Ctrl+shift+Enter:⾃动匹配相对应的语法结构,⽐如if,do-while,try-catch等结构。
7. Ctrl+F:搜索8. Ctrl+句点:在⾃动匹配下拉列表中,选中第⼀个item9. 感叹号:在⾃动匹配下拉列表中,上下键选中⼀个返回结果为boolean的item,按感叹号会⾃动取反:10. Ctrl+Enter :在⾃动匹配下拉列表中,在没有选中的item时,默认选中第⼀个item。
11. Ctrl+shift+A:快速查找android studio中的菜单。
12. Ctrl+N:可以快速打开类13. Ctrl+B:直接跳转到类、⽅法、成员变量定义的地⽅,与Ctrl+⿏标左键效果⼀样14. Ctrl+Alt+B:查询有哪些类实现了光标所在的接⼝15. Ctrl+Alt+shift+I:检测代码,⽐如检测⼀些定义了,但没有使⽤过的变量或⽅法。
检测的⽬的是为了提⾼代码效率。
`KeyEvent` 是Android 中用于表示按键事件的类。
每个按键都有一个唯一的键码(KeyCode),而`KeyEvent` 就用于描述这些按键事件的信息。
以下是一些常见的Android 键码及其对应的键值表:1. **数字键:**- `KeyEvent.KEYCODE_0` 到`KeyEvent.KEYCODE_9`2. **字母键:**- `KeyEvent.KEYCODE_A` 到`KeyEvent.KEYCODE_Z`3. **功能键:**- `KeyEvent.KEYCODE_F1` 到`KeyEvent.KEYCODE_F12`4. **控制键:**- `KeyEvent.KEYCODE_ENTER` - 回车键- `KeyEvent.KEYCODE_DEL` - 删除键- `KeyEvent.KEYCODE_ESCAPE` - 换码键(Esc键)- `KeyEvent.KEYCODE_TAB` - Tab键- `KeyEvent.KEYCODE_SPACE` - 空格键5. **方向键:**- `KeyEvent.KEYCODE_DPAD_UP` - 方向上键- `KeyEvent.KEYCODE_DPAD_DOWN` - 方向下键- `KeyEvent.KEYCODE_DPAD_LEFT` - 方向左键- `KeyEvent.KEYCODE_DPAD_RIGHT` - 方向右键6. **功能键:**- `KeyEvent.KEYCODE_HOME` - Home键- `KeyEvent.KEYCODE_BACK` - 返回键- `KeyEvent.KEYCODE_MENU` - 菜单键- `KeyEvent.KEYCODE_POWER` - 电源键7. **音量键:**- `KeyEvent.KEYCODE_VOLUME_UP` - 音量增加键- `KeyEvent.KEYCODE_VOLUME_DOWN` - 音量减小键8. **其他常见键:**- `KeyEvent.KEYCODE_MEDIA_PLAY` - 媒体播放键- `KeyEvent.KEYCODE_MEDIA_STOP` - 媒体停止键- `KeyEvent.KEYCODE_CAMERA` - 相机键- `KeyEvent.KEYCODE_CALL` - 拨号键- `KeyEvent.KEYCODE_ENDCALL` - 挂机键这只是一小部分可能用到的键码。
ConstantsgetAction() value: the key has been pressed down.getAction() value: multiple duplicate key events have occurred in a row, or a complex string is being delivered.getAction() value: the key has been released.When associated with up key events, this indicates that the key press has been canceled.Set when a key event has FLAG_CANCELED set because a long press action was executed while it was down.This mask is used for compatibility, to identify enter keys that are coming from an IME whose enter key has been auto-labelled "next" or "done".Set when a key event has been synthesized to implement default behavior for an event that the application did not handle.This mask is set if an event was known to come from a trusted part of the system.This mask is set if we don't want the key event to cause us to leave touch mode.This flag is set for the first key repeat that occurs after the long press timeout.This mask is set if the key event was generated by a software keyboard.Set for ACTION_UP when this event's key code is still being tracked from its initial down.This key event was generated by a virtual (on-screen) hard key area.This mask is set if the device woke because of this key event.Key code constant: '0' key.Key code constant: '1' key.Key code constant: '2' key.Key code constant: '3' key.Key code constant: 3D Mode key.Key code constant: '4' key.Key code constant: '5' key.Key code constant: '6' key.Key code constant: '7' key.Key code constant: '8' key.Key code constant: '9' key.Key code constant: 'A' key.Key code constant: Left Alt modifier key.Key code constant: Right Alt modifier key.Key code constant: ''' (apostrophe) key.Key code constant: App switch key.Key code constant: Assist key.Key code constant: '@' key.Key code constant: A/V Receiver input key.Key code constant: A/V Receiver power key.Key code constant: 'B' key.Key code constant: Back key.Key code constant: '\' key.Key code constant: Bookmark key.Key code constant: Break / Pause key.Key code constant: Generic Game Pad Button #1.Key code constant: Generic Game Pad Button #10.Key code constant: Generic Game Pad Button #11.Key code constant: Generic Game Pad Button #12.Key code constant: Generic Game Pad Button #13.Key code constant: Generic Game Pad Button #14.Key code constant: Generic Game Pad Button #15.Key code constant: Generic Game Pad Button #16.Key code constant: Generic Game Pad Button #2. Key code constant: Generic Game Pad Button #3. Key code constant: Generic Game Pad Button #4. Key code constant: Generic Game Pad Button #5. Key code constant: Generic Game Pad Button #6. Key code constant: Generic Game Pad Button #7. Key code constant: Generic Game Pad Button #8. Key code constant: Generic Game Pad Button #9. Key code constant: A Button key.Key code constant: B Button key.Key code constant: C Button key.Key code constant: L1 Button key.Key code constant: L2 Button key.Key code constant: Mode Button key.Key code constant: R1 Button key.Key code constant: R2 Button key.Key code constant: Select Button key.Key code constant: Start Button key.Key code constant: Left Thumb Button key.Key code constant: Right Thumb Button key.Key code constant: X Button key.Key code constant: Y Button key.Key code constant: Z Button key.Key code constant: 'C' key.Key code constant: Calculator special function key. Key code constant: Calendar special function key. Key code constant: Call key.Key code constant: Camera key.Key code constant: Caps Lock key.Key code constant: Toggle captions key.Key code constant: Channel down key.Key code constant: Channel up key.Key code constant: Clear key.Key code constant: ',' key.Key code constant: Contacts special function key. Key code constant: Left Control modifier key.Key code constant: Right Control modifier key. Key code constant: 'D' key.Key code constant: Backspace key.Key code constant: Directional Pad Center key. Key code constant: Directional Pad Down key. Key code constant: Directional Pad Left key.Key code constant: Directional Pad Right key.Key code constant: Directional Pad Up key.Key code constant: DVR key.Key code constant: 'E' key.Key code constant: Japanese alphanumeric key. Key code constant: End Call key.Key code constant: Enter key.Key code constant: Envelope special function key. Key code constant: '=' key.Key code constant: Escape key.Key code constant: Explorer special function key.Key code constant: 'F' key.Key code constant: F1 key.Key code constant: F10 key.Key code constant: F11 key.Key code constant: F12 key.Key code constant: F2 key.Key code constant: F3 key.Key code constant: F4 key.Key code constant: F5 key.Key code constant: F6 key.Key code constant: F7 key.Key code constant: F8 key.Key code constant: F9 key.Key code constant: Camera Focus key.Key code constant: Forward key.Key code constant: Forward Delete key.Key code constant: Function modifier key.Key code constant: 'G' key.Key code constant: '`' (backtick) key.Key code constant: Guide key.Key code constant: 'H' key.Key code constant: Headset Hook key.Key code constant: Japanese conversion key.Key code constant: Home key.Key code constant: 'I' key.Key code constant: Info key.Key code constant: Insert key.Key code constant: 'J' key.Key code constant: 'K' key.Key code constant: Japanese kana key.Key code constant: Japanese katakana / hiragana key. Key code constant: 'L' key.Key code constant: Language Switch key.Key code constant: '[' key.Key code constant: 'M' key.Key code constant: Manner Mode key.Key code constant: Close media key.Key code constant: Eject media key.Key code constant: Fast Forward media key.Key code constant: Play Next media key.Key code constant: Pause media key.Key code constant: Play media key.Key code constant: Play/Pause media key.Key code constant: Play Previous media key.Key code constant: Record media key.Key code constant: Rewind media key.Key code constant: Stop media key.Key code constant: Menu key.Key code constant: Left Meta modifier key.Key code constant: Right Meta modifier key.Key code constant: '-'.Key code constant: End Movement key.Key code constant: Home Movement key.Key code constant: Japanese non-conversion key.Key code constant: Music special function key.Key code constant: Mute key.Key code constant: 'N' key.Key code constant: Notification key.Key code constant: Number modifier key.Key code constant: Numeric keypad '0' key.Key code constant: Numeric keypad '1' key.Key code constant: Numeric keypad '2' key.Key code constant: Numeric keypad '3' key.Key code constant: Numeric keypad '4' key.Key code constant: Numeric keypad '5' key.Key code constant: Numeric keypad '6' key.Key code constant: Numeric keypad '7' key.Key code constant: Numeric keypad '8' key.Key code constant: Numeric keypad '9' key.Key code constant: Numeric keypad '+' key (for addition).Key code constant: Numeric keypad ',' key (for decimals or digit grouping). Key code constant: Numeric keypad '/' key (for division).Key code constant: Numeric keypad '.' key (for decimals or digit grouping). Key code constant: Numeric keypad Enter key.Key code constant: Numeric keypad '=' key.Key code constant: Numeric keypad '(' key.Key code constant: Numeric keypad '*' key (for multiplication).Key code constant: Numeric keypad ')' key.Key code constant: Numeric keypad '-' key (for subtraction).Key code constant: Num Lock key.Key code constant: 'O' key.Key code constant: 'P' key.Key code constant: Page Down key.Key code constant: Page Up key.Key code constant: '.' key.Key code constant: Picture Symbols modifier key.Key code constant: '+' key.Key code constant: '#' key.Key code constant: Power key.Key code constant: Blue "programmable" key.Key code constant: Green "programmable" key.Key code constant: Red "programmable" key.Key code constant: Yellow "programmable" key.Key code constant: 'Q' key.Key code constant: 'R' key.Key code constant: ']' key.Key code constant: Japanese Ro key.Key code constant: 'S' key.Key code constant: Scroll Lock key.Key code constant: Search key.Key code constant: ';' key.Key code constant: Settings key.Key code constant: Left Shift modifier key.Key code constant: Right Shift modifier key.Key code constant: '/' key.Key code constant: Soft Left key.Key code constant: Soft Right key.Key code constant: Space key.Key code constant: '*' key.Key code constant: Set-top-box input key.Key code constant: Set-top-box power key.Key code constant: Switch Charset modifier key.Key code constant: Symbol modifier key.Key code constant: System Request / Print Screen key.Key code constant: 'T' key.Key code constant: Tab key.Key code constant: TV key.Key code constant: TV input key.Key code constant: TV power key.Key code constant: 'U' key.Key code constant: Unknown key code.Key code constant: 'V' key.Key code constant: Volume Down key.Key code constant: Volume Mute key.Key code constant: Volume Up key.Key code constant: 'W' key.Key code constant: Window key.Key code constant: 'X' key.Key code constant: 'Y' key.Key code constant: Japanese Yen key.Key code constant: 'Z' key.Key code constant: Japanese full-width / half-width key.Key code constant: Zoom in key.Key code constant: Zoom out key.This constant was deprecated in API level 3. There are now more than MAX_KEYCODE keycodes. Use getMaxKeyCode() instead.This mask is used to check whether the left ALT meta key is pressed.This mask is a combination of META_ALT_ON, META_ALT_LEFT_ON and META_ALT_RIGHT_ON. This mask is used to check whether one of the ALT meta keys is pressed.This mask is used to check whether the right the ALT meta key is pressed.This mask is used to check whether the CAPS LOCK meta key is on.This mask is used to check whether the left CTRL meta key is pressed.This mask is a combination of META_CTRL_ON, META_CTRL_LEFT_ON andMETA_CTRL_RIGHT_ON.This mask is used to check whether one of the CTRL meta keys is pressed.This mask is used to check whether the right CTRL meta key is pressed.This mask is used to check whether the FUNCTION meta key is pressed.This mask is used to check whether the left META meta key is pressed.This mask is a combination of META_META_ON, META_META_LEFT_ON and META_META_RIGHT_ON.This mask is used to check whether one of the META meta keys is pressed. This mask is used to check whether the right META meta key is pressed.This mask is used to check whether the NUM LOCK meta key is on.This mask is used to check whether the SCROLL LOCK meta key is on.This mask is used to check whether the left SHIFT meta key is pressed.This mask is a combination of META_SHIFT_ON, META_SHIFT_LEFT_ON and META_SHIFT_RIGHT_ON.This mask is used to check whether one of the SHIFT meta keys is pressed. This mask is used to check whether the right SHIFT meta key is pressed.This mask is used to check whether the SYM meta key is pressed.。
Android Studio快捷键提示Ctrl+P方法参数提示Ctrl+空格代码提示Ctrl+Shift+Space在很多时候都能够给出Smart提示Ctrl+Alt+Space类名或接口名提示查看Alt+1快速打开或隐藏工程面板Ctrl+H查看类结构图Ctrl+F12查看当前文件的结构Ctrl+Q查看注释文档(JavaDoc)Alt+Q查看当前方法的声明Ctrl+W选中单词继而语句继而行继而函数查找Alt + F1查找代码所在位置Ctrl + F7查找当前元素在当前文件中的引用,然后按F3可以选择Alt + F3快速查找Ctrl + Shift + F7可以高亮当前元素在当前文件中的使用Ctrl + Shift+N查找文件Ctrl + Shift+Alt+N查找类中的方法或变量Ctrl + B查找打开光标处的类或方法Ctrl + N快速查找类Ctrl + F查找文本Ctrl+Shift+Alt+N可以快速打开符号快速打开类/文件/符号时,可以使用通配符,也可以使用缩写Ctrl+Alt+Up /Ctrl+Alt+Down可以快速跳转搜索结果修复Shift+F6重构-重命名Ctrl+X删除行Ctrl+D复制行Ctrl+/ 或 Ctrl+Shift+/ 注释(// 或者/*...*/ )Alt+Insert可以生成构造器/Getter/Setter等Ctrl+Alt+L格式化代码Ctrl+R替换文本Alt+Enter导入包,自动修正Ctrl+Alt+O优化导入的类和包Ctrl+J自动代码Ctrl+Shift+Space自动补全代码Ctrl+Alt+Space类名自动完成Ctrl+Shift+Insert可以选择剪贴板内容并插入Ctrl+Shift+J可以整合两行Ctrl+Alt+T可以把代码包在一块内,例如try/catchCtrl+Alt+V可以引入变量。
例如把括号内的SQL赋成一个变量Alt+F8计算变量值Ctrl+O可以选择父类的方法进行重写最近相关Ctrl+E最近打开的文件 ----------Ctrl+Shift+Backspace可以跳转到上次编辑的地方Ctrl+Alt+ left/right返回至上次浏览的位置Ctrl+E或者Alt+Shift+C 最近更改的代码Alt+Shift+C对比最近修改的代码移动Ctrl+Shift+Up/Down代码向上/下移动。
Ctrl+N 查找类Ctrl+Shift+N 查找文件Ctrl+Alt+L 格式化代码Ctrl+Alt+O 优化导入的类和包Alt+Insert 生成代码(如get,set方法,构造函数等)Ctrl+E或者Alt+Shift+C 最近更改的代码Ctrl+R 替换文本Ctrl+F 查找文本Ctrl+Shift+Space 自动补全代码Ctrl+空格代码提示Ctrl+Alt+Space 类名或接口名提示Ctrl+P 方法参数提示Ctrl+Shift+Alt+N 查找类中的方法或变量Alt+Shift+C 对比最近修改的代码Shift+F6 重构-重命名Ctrl+Shift+先上键Ctrl+X 删除行Ctrl+D 复制行Ctrl+/ 或 Ctrl+Shift+/ 注释(// 或者/*...*/ )Ctrl+J 自动代码Ctrl+E 最近打开的文件Ctrl+H 显示类结构图Ctrl+Q 显示注释文档Alt+F1 查找代码所在位置Alt+1 快速打开或隐藏工程面板Ctrl+Alt+ left/right 返回至上次浏览的位置Alt+ left/right 切换代码视图Alt+ Up/Down 在方法间快速移动定位Ctrl+Shift+Up/Down 代码向上/下移动。
F2 或Shift+F2 高亮错误或警告快速定位代码标签输入完成后,按Tab,生成代码。
选中文本,按Ctrl+Shift+F7 ,高亮显示所有该文本,按Esc高亮消失。
Ctrl+W 选中代码,连续按会有其他效果选中文本,按Alt+F3 ,逐个往下查找相同文本,并高亮显示。
Ctrl+Up/Down 光标跳转到第一行或最后一行下Ctrl+B 快速打开光标处的类或方法最常用快捷键1.Ctrl+E,可以显示最近编辑的文件列表2.Shift+Click可以关闭文件3.Ctrl+[或]可以跳到大括号的开头结尾4.Ctrl+Shift+Backspace可以跳转到上次编辑的地方5.Ctrl+F12,可以显示当前文件的结构6.Ctrl+F7可以查询当前元素在当前文件中的引用,然后按F3可以选择7.Ctrl+N,可以快速打开类8.Ctrl+Shift+N,可以快速打开文件9.Alt+Q可以看到当前方法的声明10.Ctrl+W可以选择单词继而语句继而行继而函数11.Alt+F1可以将正在编辑的元素在各个面板中定位12.Ctrl+P,可以显示参数信息13.Ctrl+Shift+Insert可以选择剪贴板内容并插入14.Alt+Insert可以生成构造器/Getter/Setter等15.Ctrl+Alt+V 可以引入变量。
ConstantsgetAction() value: the key has been pressed down.getAction() value: multiple duplicate key events have occurred in a row, or a complex string is being delivered.getAction() value: the key has been released.When associated with up key events, this indicates that the key press has been canceled.Set when a key event has FLAG_CANCELED set because a long press action was executed while it was down.This mask is used for compatibility, to identify enter keys that are coming from an IME whose enter key has been auto-labelled "next" or "done".Set when a key event has been synthesized to implement default behavior for an event that the application did not handle.This mask is set if an event was known to come from a trusted part of the system.This mask is set if we don't want the key event to cause us to leave touch mode.This flag is set for the first key repeat that occurs after the long press timeout.This mask is set if the key event was generated by a software keyboard.Set for ACTION_UP when this event's key code is still being tracked from its initial down.This key event was generated by a virtual (on-screen) hard key area.This mask is set if the device woke because of this key event.Key code constant: '0' key.Key code constant: '1' key.Key code constant: '2' key.Key code constant: '3' key.Key code constant: 3D Mode key.Key code constant: '4' key.Key code constant: '5' key.Key code constant: '6' key.Key code constant: '7' key.Key code constant: '8' key.Key code constant: '9' key.Key code constant: 'A' key.Key code constant: Left Alt modifier key.Key code constant: Right Alt modifier key.Key code constant: ''' (apostrophe) key.Key code constant: App switch key.Key code constant: Assist key.Key code constant: '@' key.Key code constant: A/V Receiver input key.Key code constant: A/V Receiver power key.Key code constant: 'B' key.Key code constant: Back key.Key code constant: '\' key.Key code constant: Bookmark key.Key code constant: Break / Pause key.Key code constant: Generic Game Pad Button #1.Key code constant: Generic Game Pad Button #10.Key code constant: Generic Game Pad Button #11.Key code constant: Generic Game Pad Button #12.Key code constant: Generic Game Pad Button #13.Key code constant: Generic Game Pad Button #14.Key code constant: Generic Game Pad Button #15.Key code constant: Generic Game Pad Button #16.Key code constant: Generic Game Pad Button #2. Key code constant: Generic Game Pad Button #3. Key code constant: Generic Game Pad Button #4. Key code constant: Generic Game Pad Button #5. Key code constant: Generic Game Pad Button #6. Key code constant: Generic Game Pad Button #7. Key code constant: Generic Game Pad Button #8. Key code constant: Generic Game Pad Button #9. Key code constant: A Button key.Key code constant: B Button key.Key code constant: C Button key.Key code constant: L1 Button key.Key code constant: L2 Button key.Key code constant: Mode Button key.Key code constant: R1 Button key.Key code constant: R2 Button key.Key code constant: Select Button key.Key code constant: Start Button key.Key code constant: Left Thumb Button key.Key code constant: Right Thumb Button key.Key code constant: X Button key.Key code constant: Y Button key.Key code constant: Z Button key.Key code constant: 'C' key.Key code constant: Calculator special function key. Key code constant: Calendar special function key. Key code constant: Call key.Key code constant: Camera key.Key code constant: Caps Lock key.Key code constant: Toggle captions key.Key code constant: Channel down key.Key code constant: Channel up key.Key code constant: Clear key.Key code constant: ',' key.Key code constant: Contacts special function key. Key code constant: Left Control modifier key.Key code constant: Right Control modifier key. Key code constant: 'D' key.Key code constant: Backspace key.Key code constant: Directional Pad Center key. Key code constant: Directional Pad Down key. Key code constant: Directional Pad Left key.Key code constant: Directional Pad Right key.Key code constant: Directional Pad Up key.Key code constant: DVR key.Key code constant: 'E' key.Key code constant: Japanese alphanumeric key. Key code constant: End Call key.Key code constant: Enter key.Key code constant: Envelope special function key. Key code constant: '=' key.Key code constant: Escape key.Key code constant: Explorer special function key.Key code constant: 'F' key.Key code constant: F1 key.Key code constant: F10 key.Key code constant: F11 key.Key code constant: F12 key.Key code constant: F2 key.Key code constant: F3 key.Key code constant: F4 key.Key code constant: F5 key.Key code constant: F6 key.Key code constant: F7 key.Key code constant: F8 key.Key code constant: F9 key.Key code constant: Camera Focus key.Key code constant: Forward key.Key code constant: Forward Delete key.Key code constant: Function modifier key.Key code constant: 'G' key.Key code constant: '`' (backtick) key.Key code constant: Guide key.Key code constant: 'H' key.Key code constant: Headset Hook key.Key code constant: Japanese conversion key.Key code constant: Home key.Key code constant: 'I' key.Key code constant: Info key.Key code constant: Insert key.Key code constant: 'J' key.Key code constant: 'K' key.Key code constant: Japanese kana key.Key code constant: Japanese katakana / hiragana key. Key code constant: 'L' key.Key code constant: Language Switch key.Key code constant: '[' key.Key code constant: 'M' key.Key code constant: Manner Mode key.Key code constant: Close media key.Key code constant: Eject media key.Key code constant: Fast Forward media key.Key code constant: Play Next media key.Key code constant: Pause media key.Key code constant: Play media key.Key code constant: Play/Pause media key.Key code constant: Play Previous media key.Key code constant: Record media key.Key code constant: Rewind media key.Key code constant: Stop media key.Key code constant: Menu key.Key code constant: Left Meta modifier key.Key code constant: Right Meta modifier key.Key code constant: '-'.Key code constant: End Movement key.Key code constant: Home Movement key.Key code constant: Japanese non-conversion key.Key code constant: Music special function key.Key code constant: Mute key.Key code constant: 'N' key.Key code constant: Notification key.Key code constant: Number modifier key.Key code constant: Numeric keypad '0' key.Key code constant: Numeric keypad '1' key.Key code constant: Numeric keypad '2' key.Key code constant: Numeric keypad '3' key.Key code constant: Numeric keypad '4' key.Key code constant: Numeric keypad '5' key.Key code constant: Numeric keypad '6' key.Key code constant: Numeric keypad '7' key.Key code constant: Numeric keypad '8' key.Key code constant: Numeric keypad '9' key.Key code constant: Numeric keypad '+' key (for addition).Key code constant: Numeric keypad ',' key (for decimals or digit grouping). Key code constant: Numeric keypad '/' key (for division).Key code constant: Numeric keypad '.' key (for decimals or digit grouping). Key code constant: Numeric keypad Enter key.Key code constant: Numeric keypad '=' key.Key code constant: Numeric keypad '(' key.Key code constant: Numeric keypad '*' key (for multiplication).Key code constant: Numeric keypad ')' key.Key code constant: Numeric keypad '-' key (for subtraction).Key code constant: Num Lock key.Key code constant: 'O' key.Key code constant: 'P' key.Key code constant: Page Down key.Key code constant: Page Up key.Key code constant: '.' key.Key code constant: Picture Symbols modifier key.Key code constant: '+' key.Key code constant: '#' key.Key code constant: Power key.Key code constant: Blue "programmable" key.Key code constant: Green "programmable" key.Key code constant: Red "programmable" key.Key code constant: Yellow "programmable" key.Key code constant: 'Q' key.Key code constant: 'R' key.Key code constant: ']' key.Key code constant: Japanese Ro key.Key code constant: 'S' key.Key code constant: Scroll Lock key.Key code constant: Search key.Key code constant: ';' key.Key code constant: Settings key.Key code constant: Left Shift modifier key.Key code constant: Right Shift modifier key.Key code constant: '/' key.Key code constant: Soft Left key.Key code constant: Soft Right key.Key code constant: Space key.Key code constant: '*' key.Key code constant: Set-top-box input key.Key code constant: Set-top-box power key.Key code constant: Switch Charset modifier key.Key code constant: Symbol modifier key.Key code constant: System Request / Print Screen key.Key code constant: 'T' key.Key code constant: Tab key.Key code constant: TV key.Key code constant: TV input key.Key code constant: TV power key.Key code constant: 'U' key.Key code constant: Unknown key code.Key code constant: 'V' key.Key code constant: Volume Down key.Key code constant: Volume Mute key.Key code constant: Volume Up key.Key code constant: 'W' key.Key code constant: Window key.Key code constant: 'X' key.Key code constant: 'Y' key.Key code constant: Japanese Yen key.Key code constant: 'Z' key.Key code constant: Japanese full-width / half-width key.Key code constant: Zoom in key.Key code constant: Zoom out key.This constant was deprecated in API level 3. There are now more than MAX_KEYCODE keycodes. Use getMaxKeyCode() instead.This mask is used to check whether the left ALT meta key is pressed.This mask is a combination of META_ALT_ON, META_ALT_LEFT_ON and META_ALT_RIGHT_ON. This mask is used to check whether one of the ALT meta keys is pressed.This mask is used to check whether the right the ALT meta key is pressed.This mask is used to check whether the CAPS LOCK meta key is on.This mask is used to check whether the left CTRL meta key is pressed.This mask is a combination of META_CTRL_ON, META_CTRL_LEFT_ON andMETA_CTRL_RIGHT_ON.This mask is used to check whether one of the CTRL meta keys is pressed.This mask is used to check whether the right CTRL meta key is pressed.This mask is used to check whether the FUNCTION meta key is pressed.This mask is used to check whether the left META meta key is pressed.This mask is a combination of META_META_ON, META_META_LEFT_ON and META_META_RIGHT_ON.This mask is used to check whether one of the META meta keys is pressed. This mask is used to check whether the right META meta key is pressed.This mask is used to check whether the NUM LOCK meta key is on.This mask is used to check whether the SCROLL LOCK meta key is on.This mask is used to check whether the left SHIFT meta key is pressed.This mask is a combination of META_SHIFT_ON, META_SHIFT_LEFT_ON and META_SHIFT_RIGHT_ON.This mask is used to check whether one of the SHIFT meta keys is pressed. This mask is used to check whether the right SHIFT meta key is pressed.This mask is used to check whether the SYM meta key is pressed.。
Alt+回车导入包,自动修正Ctrl+N 查找类Ctrl+Shift+N 查找文件Ctrl+Alt+L 格式化代码Ctrl+Alt+O 优化导入的类和包Alt+Insert 生成代码(如get,set方法,构造函数等) Ctrl+E或者Alt+Shift+C 最近更改的代码Ctrl+R 替换文本Ctrl+F 查找文本Ctrl+Shift+Space 自动补全代码Ctrl+空格代码提示Ctrl+Alt+Space 类名或接口名提示Ctrl+P 方法参数提示Ctrl+Shift+Alt+N 查找类中的方法或变量Alt+Shift+C 对比最近修改的代码Shift+F6 重构-重命名Ctrl+Shift+先上键Ctrl+X 删除行Ctrl+D 复制行Ctrl+/ 或Ctrl+Shift+/ 注释(// 或者)Ctrl+J 自动代码Ctrl+E 最近打开的文件Ctrl+H 显示类结构图Ctrl+Q 显示注释文档Alt+F1 查找代码所在位置Alt+1 快速打开或隐藏工程面板Ctrl+Alt+ left/right 返回至上次浏览的位置Alt+ left/right 切换代码视图Alt+ Up/Down 在方法间快速移动定位Ctrl+Shift+Up/Down 代码向上/下移动。
F2 或Shift+F2 高亮错误或警告快速定位代码标签输入完成后,按Tab,生成代码。
选中文本,按Ctrl+Shift+F7 ,高亮显示所有该文本,按Esc高亮消失。
Ctrl+W 选中代码,连续按会有其他效果选中文本,按Alt+F3 ,逐个往下查找相同文本,并高亮显示。
Ctrl+Up/Down 光标跳转到第一行或最后一行下Ctrl+B 快速打开光标处的类或方法最常用快捷键1.Ctrl+E,可以显示最近编辑的文件列表2.Shift+Click可以关闭文件3.Ctrl+[或]可以跳到大括号的开头结尾4.Ctrl+Shift+Backspace可以跳转到上次编辑的地方5.Ctrl+F12,可以显示当前文件的结构6.Ctrl+F7可以查询当前元素在当前文件中的引用,然后按F3可以选择7.Ctrl+N,可以快速打开类8.Ctrl+Shift+N,可以快速打开文件9.Alt+Q可以看到当前方法的声明10.Ctrl+W可以选择单词继而语句继而行继而函数11.Alt+F1可以将正在编辑的元素在各个面板中定位12.Ctrl+P,可以显示参数信息13.Ctrl+Shift+Insert可以选择剪贴板内容并插入14.Alt+Insert可以生成构造器/Getter/Setter等15.Ctrl+Alt+V 可以引入变量。