根据KeyboardView.OnKeyboardActionListener.onRelease()SDK文档,"对于重复的键,这只被调用一次".但是,如果我设置isRepeatable真要与Android Softkeyboard比如"一"键,和日志onPress(),onKey()以及onRelease()方法调用,我得到重复的预期,但我遵守以下日志,只需按一下/复读/释放顺序:
I/SoftKeyboard(31467): onPress: 97
I/SoftKeyboard(31467): onKey: 97
I/SoftKeyboard(31467): onRelease: 97
I/SoftKeyboard(31467): onKey: 97
I/SoftKeyboard(31467): onRelease: 97
I/SoftKeyboard(31467): onKey: 97
I/SoftKeyboard(31467): onRelease: 97
I/SoftKeyboard(31467): onKey: 97
I/SoftKeyboard(31467): onRelease: 97
I/SoftKeyboard(31467): onKey: 97
I/SoftKeyboard(31467): onRelease: 97
Run Code Online (Sandbox Code Playgroud)
如何确定触摸设备的确切释放时间?感谢:D.
编辑(Paul Boddington编辑30/07/2015)
虽然我不是OP,但我想提供一个显示问题的完整示例.
MyActivity:
public class MyActivity extends Activity {
private static final String TAG = "MyActivity";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_my);
KeyboardView keyboardView = (KeyboardView) findViewById(R.id.keyboard_view);
keyboardView.setKeyboard(new Keyboard(this, R.xml.keyboard));
keyboardView.setOnKeyboardActionListener(new KeyboardView.OnKeyboardActionListener() …Run Code Online (Sandbox Code Playgroud)