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'是错的,不知有没有解决办法,或其它检测办法