浏览代码

Keyboard Handling [5/8]: Update rfb.js to connect mouse events to keyboard handler

This allows the keyboard handler to check modifier key state much more frequently

Since some browsers never send keyup events for modifier keys, we have to
synchronize modifier state whenever we get a mouse or keyboard event
jalf 11 年之前
父节点
当前提交
fa30469cda
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      include/rfb.js

+ 2 - 1
include/rfb.js

@@ -222,7 +222,8 @@ function constructor() {
                                 'onKeyPress': keyPress});
     mouse    = new Mouse({'target': conf.target,
                             'onMouseButton': mouseButton,
-                            'onMouseMove': mouseMove});
+                            'onMouseMove': mouseMove,
+                            'notify': keyboard.sync});
 
     rmode = display.get_render_mode();