搭上了Android的特殊字符键preSS [英] Catch keypress of special characters with android

查看:139
本文介绍了搭上了Android的特殊字符键preSS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎么能赶上那些在SW键盘的所有字符的关键preSS?
在活动覆盖的onkeydown()仅适用于标准的ASCII字符像-Z0-9! - / ...但并不适用于所有的UTF8字符像ščřž工作(在这种情况下,这种方法是不是在所有的称呼)
我知道该KeyEvent有一个方法getUni codeCHAR(),它返回UNI code字符键将产生。但我不知道如何获取的KeyEvent时的onkeydown()没有被调用。

how can I catch a keypress of all characters that are on sw keyboards? Overriding onKeyDown() in the activity works only for standard ASCII characters like a-z0-9-!/... but doesn't work with all the UTF8 chars like ščřž (in that case this method is not called at all) I know the KeyEvent has a method getUnicodeChar(), which returns the unicode character that the key would produce. But I dont know how to get that KeyEvent when onKeyDown() is not called.

推荐答案

我还没有尝试过,但有一个名为dispatchKeyEvent(KeyEvent的事件)的方法。我希望它一定会满足乌尔需求。

I have not tried it but there is a method called dispatchKeyEvent(KeyEvent event). I hope it will surely meet ur needs.

这篇关于搭上了Android的特殊字符键preSS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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