如何捕捉"完成"从软键盘按键preSS [英] How to catch a "Done" key press from the soft keyboard

查看:219
本文介绍了如何捕捉"完成"从软键盘按键preSS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎么赶在软键盘的特定按键事件? 特别是我很感兴趣的完成键。

how do I catch specific key events from the soft keyboard? specifically I'm interested in the "Done" key.

谢谢, 大利

推荐答案

您捕捉的KeyEvent,然后检查其关键code。 FLAG_EDITOR_ACTION用于识别从它们一个IME的输入键已被自动标记的未来输入键下一个或完成

You catch the KeyEvent and then check its keycode. FLAG_EDITOR_ACTION is used to identify enter keys that are coming from an IME whose enter key has been auto-labelled "next" or "done"

if (event.getKeyCode() == KeyEvent.FLAG_EDITOR_ACTION)
    //your code here

查找文档这里

这篇关于如何捕捉"完成"从软键盘按键preSS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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