是什么触发(或产生)KeyEvent.ACTION_MULTIPLE? [英] What triggers (or generates) KeyEvent.ACTION_MULTIPLE?

查看:2216
本文介绍了是什么触发(或产生)KeyEvent.ACTION_MULTIPLE?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

的文档<一个href="http://developer.android.com/reference/android/view/KeyEvent.html#ACTION_MULTIPLE">KeyEvent.ACTION_MULTIPLE说:

多个重复的关键事件都发生在一排,或复杂   串被传递。如果密钥code不是{#LINK   KEY code_UNKNOWN那么{#LINK getRepeatCount()方法返回   次数定键code应该执行。否则,如果   关键code是关键code_UNKNOWN,那么这是一个字符序列   通过getCharacters()作为返回。

"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()."

不过,这并不说如何以实际生成的事件。

But it doesn't say how to actually generate that event.

  1. 在我试过(快速)双击我收到了耳机的暂停/播放键,但都是普通ACTION_UP和ACTION_DOWN。
  2. 我也试过 pressing并按住耳机的暂停/播放键,但我收到的普通ACTION_UP和ACTION_DOWN。
  1. I tried (rapidly) double-clicking the headset's Pause/Play button, but all I receive is ordinary ACTION_UP and ACTION_DOWN.
  2. I also tried pressing and holding down the headset's Pause/Play button, but all I receive is ordinary ACTION_UP and ACTION_DOWN.

如何生成一个<一个href="http://developer.android.com/reference/android/view/KeyEvent.html#ACTION_MULTIPLE">KeyEvent.ACTION_MULTIPLE (作为一个用户,使用耳机控制)?

How do I generate a KeyEvent.ACTION_MULTIPLE (as a user, using a headset control)?

推荐答案

Android的<一个href="https://android.googlesource.com/platform/frameworks/base/+/refs/heads/master/core/java/android/text/method/BaseMovementMethod.java"相对=nofollow> BaseMovementMethod 包括code办理 ACTION_MULTIPLE 所以psumably是关键自动重复生成的事件$ P $当用户持有向下箭头键。

Android's BaseMovementMethod includes code for handling ACTION_MULTIPLE so presumably the event is generated for key auto-repeat when the user holds down an arrow key.

这篇关于是什么触发(或产生)KeyEvent.ACTION_MULTIPLE?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆