KeyEvent.ACTION_MULTIPLE 的文档说:
"multiple duplicate key events have occurred in a row, or a complex string is being delivered. If the key code is not {#link KEYCODE_UNKNOWN then the {#link getRepeatCount() method returns the number of times the given key code should be executed. Otherwise, if the key code is KEYCODE_UNKNOWN, then this is a sequence of characters as returned by getCharacters()."
但它没有说明如何实际生成该事件。
- 我尝试(快速)双击耳机的暂停/播放按钮,但我收到的只是普通的 ACTION_UP 和 ACTION_DOWN。
- 我也尝试按住耳机的暂停/播放按钮,但我收到的只是普通的 ACTION_UP 和 ACTION_DOWN。
如何生成 KeyEvent.ACTION_MULTIPLE (作为用户,使用耳机控制)?
最佳答案
Android 的 BaseMovementMethod包含用于处理 ACTION_MULTIPLE
的代码,因此大概会在用户按住箭头键时为键自动重复生成事件。
关于android - 什么触发(或生成)KeyEvent.ACTION_MULTIPLE?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15286312/