Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

local keychar = string.format("%c",keycode) 修正建議 #3

Open
shewer opened this issue Oct 6, 2020 · 1 comment
Open

local keychar = string.format("%c",keycode) 修正建議 #3

shewer opened this issue Oct 6, 2020 · 1 comment

Comments

@shewer
Copy link

shewer commented Oct 6, 2020

發現這有問題
方向鍵的keycode 會轉出 大寫 ascii
https://github.com/rime/librime/blob/master/src/rime/gear/ascii_composer.cc:121:
if (!key_event.release() && ch >= 0x20 && ch < 0x80) {
ctx->PushInput(ch);
return kAccepted;

keychar= (keycode >=0x20 and keycode <0x80 and string.char(keycode) ) or ""

@sdadonkey
Copy link
Owner

是,它傳回的keycode是0x0-0xffff的,超出0xff的經過string.format("%c",keycode)會返回不正確的ascii字符。你的方法固然可以,但我的程序也沒有問題,因爲我是根據keycode範圍而不是keychar去做相應的操作。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants