有什么不同?
public boolean onKeyDown(int keyCode,KeyEvent event)
参数是keyCode,按钮,用户按下,但KeyEvent是什么?
解决方法:
阅读docs
Object used to report key and button events.
Each key press is described by a sequence of key events. A key press starts with a key event with ACTION_DOWN. If the key is held sufficiently long that it repeats, then the initial down is followed additional key events with ACTION_DOWN and a non-zero value for getRepeatCount(). The last key event is a ACTION_UP for the key up. If the key press is canceled, the key up event will have the FLAG_CANCELED flag set.