Repository navigation
按键和文字:modavd_key、modavd_input_text 走模拟器控制台 - #19
Merged
Merged
Conversation
文字:编辑框有焦点且宿主输入法在用时走 ime commit(任意语言),否则 ASCII 走 event text,每 4 个字符一条、间隔 4 ms(一次发多了客体键盘队列溢出,整段丢)。按键:控制台有 event key 时发真实按键;没有时只有能打出字符的键和编辑框里的编辑键可用,其余返回 MODAVD_E_UNSUPPORTED。接口版本 3,MODAVD_CAP_TEXT 恒有,MODAVD_CAP_KEY 看控制台有没有 event key。
模拟器的键盘在客体里用 /vendor/usr/keylayout/qwerty.kl,不是 Generic.kl。键盘上没有的键(FORWARD_DEL、MOVE_HOME 等)照没有 event key 时的办法走。带 event key 的模拟器上实测:返回、主页、多任务、Esc、退格、回车。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
modavd_key和modavd_input_text从「已声明、返回不支持」变成能用,接口版本升到 3。和点击一样走模拟器控制台,不经 adb。文字
org.modavd.ime)在用时,走控制台的ime commit,文字原样交给编辑框,任意语言。换行发成回车键。event text,由模拟器的键盘打出来。每条命令最多 4 个字符,发完停 4 ms:一次发得多了,客体键盘的队列装不下,整段都会丢。MODAVD_E_UNSUPPORTED,什么都不打。按键
event key <linux 键码> <0|1>时,按的是模拟器键盘上的真实按键,按下、抬起分开发,返回、主页、多任务也在内。这条命令现在发布的模拟器(0.40.x)还没有,会跟下一次模拟器重编一起发;库不带参数发一次event key,看回的是用法还是bad sub-command来判断,每个控制台会话只问一次。event text;编辑键(退格、方向键等)在编辑框有焦点时走ime key;其余返回MODAVD_E_UNSUPPORTED。这两条路按下时就把按下和抬起一起发了,抬起不再发东西。/vendor/usr/keylayout/qwerty.kl写,不是Generic.kl:主页键是 102;Esc 键被这张表读作返回。能力位
MODAVD_CAP_TEXT:接口版本 3 起恒有。MODAVD_CAP_KEY:控制台有event key时才有。为此modavd_capabilities()第一次调用会连一次控制台。测试
event key、编辑框有没有焦点分别回话,核对库发出的每一行命令;文字分段、转义、UTF-8 切分的纯函数另测。Windows 本机 3 组全过。event key的模拟器:返回、主页、多任务、Esc、退格、回车都生效;明日方舟里返回键弹出退出确认框,Esc 把它关掉。发版(版本号、发版说明)另开 PR。