文件名称:AndroidKeyEventMoveGif
介绍说明--下载内容均来自于网络,请自行研究使用
Android 响应键盘移动图标,程序很简短,也很清楚直观.利用android.view.SurfaceView建立视图。通过使用键盘事件,熟悉SurfaceView画布的用法。-public boolean onKeyDown(int keyCode, KeyEvent event) {
// TODO Auto-generated method stub
switch (keyCode) {
case KeyEvent.KEYCODE_DPAD_UP:
up=true
break
case KeyEvent.KEYCODE_DPAD_DOWN:
down=true
break
case KeyEvent.KEYCODE_DPAD_LEFT:
left=true
break
case KeyEvent.KEYCODE_DPAD_RIGHT:
right=true
break
// TODO Auto-generated method stub
switch (keyCode) {
case KeyEvent.KEYCODE_DPAD_UP:
up=true
break
case KeyEvent.KEYCODE_DPAD_DOWN:
down=true
break
case KeyEvent.KEYCODE_DPAD_LEFT:
left=true
break
case KeyEvent.KEYCODE_DPAD_RIGHT:
right=true
break
(系统自动生成,下载前可以参看下载内容)
下载文件列表
AndroidKeyEventMoveGif.doc