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

KUMU · September 09, 2025 · 63 hits
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'是错的,不知有没有解决办法,或其它检测办法

No Reply at the moment.
You need to Sign in before reply, if you don't have an account, please Sign up first.