设为首页 加入收藏

TOP

Android应用程序模拟手机按键(一)
2015-07-26 13:14:08 来源: 作者: 【 】 浏览:66
Tags:Android 应用程序 模拟 手机 按键

  1、先来看看Android中对按键和值的定义方式:


?public static final int KEYCODE_UNKNOWN? ? ? ? = 0;
/** Key code constant: Soft Left key. */
public static final int KEYCODE_SOFT_LEFT? ? ? = 1;
/** Key code constant: Soft Right key. */
public static final int KEYCODE_SOFT_RIGHT? ? ? = 2;
/** Key code constant: Home key. */
public static final int KEYCODE_HOME? ? ? ? ? ? = 3;
/** Key code constant: Back key. */
public static final int KEYCODE_BACK? ? ? ? ? ? = 4;
/** Key code constant: Call key. */
public static final int KEYCODE_CALL? ? ? ? ? ? = 5;
/** Key code constant: End Call key. */
public static final int KEYCODE_ENDCALL? ? ? ? = 6;
/** Key code constant: '0' key. */
public static final int KEYCODE_0? ? ? ? ? ? ? = 7;
/** Key code constant: '1' key. */
public static final int KEYCODE_1? ? ? ? ? ? ? = 8;
/** Key code constant: '2' key. */
public static final int KEYCODE_2? ? ? ? ? ? ? = 9;
/** Key code constant: '3' key. */
public static final int KEYCODE_3? ? ? ? ? ? ? = 10;
/** Key code constant: '4' key. */
public static final int KEYCODE_4? ? ? ? ? ? ? = 11;
/** Key code constant: '5' key. */
public static final int KEYCODE_5? ? ? ? ? ? ? = 12;
/** Key code constant: '6' key. */
public static final int KEYCODE_6? ? ? ? ? ? ? = 13;
/** Key code constant: '7' key. */
public static final int KEYCODE_7? ? ? ? ? ? ? = 14;
/** Key code constant: '8' key. */
public static final int KEYCODE_8? ? ? ? ? ? ? = 15;
/** Key code constant: '9' key. */
public static final int KEYCODE_9? ? ? ? ? ? ? = 16;
/** Key code constant: '*' key. */
public static final int KEYCODE_STAR? ? ? ? ? ? = 17;
/** Key code constant: '#' key. */
public static final int KEYCODE_POUND? ? ? ? ? = 18;
/** Key code constant: Directional Pad Up key.
?* May also be synthesized from trackball motions. */
public static final int KEYCODE_DPAD_UP? ? ? ? = 19;
/** Key code constant: Directional Pad Down key.
?* May also be synthesized from trackball motions. */
public static final int KEYCODE_DPAD_DOWN? ? ? = 20;
/** Key code constant: Directional Pad Left key.
?* May also be synthesized from trackball motions. */
public static final int KEYCODE_DPAD_LEFT? ? ? = 21;
/** Key code constant: Directional Pad Right key.
?* May also be synthesized from trackball motions. */
public static final int KEYCODE_DPAD_RIGHT? ? ? = 22;
/** Key code constant: Directional Pad Center key.
?* May also be synthesized from trackball motions. */
public static final int KEYCODE_DPAD_CENTER? ? = 23;
/** Key code constant: Volume Up key.
?* Adjusts the speaker volume up. */
public static final int KEYCODE_VOLUME_UP? ? ? = 24;
/** Key code constant: Volume Down key.
?* Adjusts the speaker volume down. */
public static final int KEYCODE_VOLUME_DOWN? ? = 25;
/** Key code constant: Power key. */
public static final int KEYCODE_POWER? ? ? ? ? = 26;
/** Key code constant: Camera key.
?* Used to launch a camera application or take pictures. */
public static final int KEYCODE_CAMERA? ? ? ? ? = 27;
/** Key code constant: Clear key. */
public static final int KEYCODE_CLEAR? ? ? ? ? = 28;
/** Key code constant: 'A' key. */
public static final int KEYCODE_A? ? ? ? ? ? ? = 29;
/** Key code constant: 'B' key. */
public static final int KEYCODE_B? ? ? ? ? ? ? = 30;
/** Key code constant: 'C' key. */
public static final int KEYCODE_C? ? ? ? ? ? ? = 31;
/** Key code constant: 'D' key. */
public static final int KEYCODE_D? ? ? ? ? ? ? = 32;
/** Key code constant: 'E' key. */
public static final int KEYCODE_E? ? ? ? ? ? ? = 33;
/** Key code constant: 'F' key. */
public static final int KEYCODE_F? ? ? ? ? ? ? = 34;
/** Key code constant: 'G' key. */
public static final int KEYCODE_G? ? ? ? ? ? ? = 35;
/** Key code constant: 'H' key. */
public static final int KEYCODE_H? ? ? ? ? ? ? = 36;
/

首页 上一页 1 2 3 下一页 尾页 1/3/3
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇C#和JavaScript中数组去重总结 下一篇Android浮动小球与开机自启动

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: