mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-02-01 18:41:54 +08:00
release keys when window loosing focus
This commit is contained in:
@@ -24,13 +24,17 @@ var keyboard = new function() {
|
||||
};
|
||||
|
||||
this.setSocket = function(ws) {
|
||||
keyboard.releaseAll();
|
||||
__ws = ws;
|
||||
$("hid-keyboard-led").className = (ws ? "led-on" : "led-off");
|
||||
};
|
||||
|
||||
this.releaseAll = function(ws) {
|
||||
__keys.concat(__modifiers).forEach(function(el_key) {
|
||||
if (__isActive(el_key)) {
|
||||
keyboard.fireEvent(el_key.id, false);
|
||||
}
|
||||
});
|
||||
__ws = ws;
|
||||
$("hid-keyboard-led").className = (ws ? "led-on" : "led-off");
|
||||
};
|
||||
|
||||
this.fireEvent = function(code, state) {
|
||||
|
||||
Reference in New Issue
Block a user