gpt4 book ai didi

android - 从android中的onKeyDown事件获取Unicode字符

转载 作者:行者123 更新时间:2023-11-29 02:09:33 25 4
gpt4 key购买 nike

我想在输入软键盘时获取 Unicode 字符(我使用按键事件)。

    @Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
//I tried this but not work
Log.d(TAG,event.getCharacters());

}

例如,当我输入以下内容时:'~'、'@'、'a'、'ă'、'©' 如果我有键码,如何获取这些字符?提前致谢!

最佳答案

查看 the KeyEvent docs并在页面上搜索“@”。他们似乎都在那里。另见 getUnicodeChar()方法。

关于android - 从android中的onKeyDown事件获取Unicode字符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8279065/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com