Ruby ruby tk 右 shift 键松开检测有误

KUMU · 2025年09月09日 · 63 次阅读
require 'tk'
root = TkRoot.new
root.bind('KeyPress') do |event|
    p event.keysym
end

root.bind('KeyRelease') do |event|
    p event.keysym
end

Tk.mainloop

运行上面的程序,按下和松开右 shift 键时按下返回'Shift_R'是对的,当松开返回'Shift_L'是错的,不知有没有解决办法,或其它检测办法

暂无回复。
需要 登录 后方可回复, 如果你还没有账号请 注册新账号