mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-02-01 10:31:54 +08:00
interactive hid leds
This commit is contained in:
@@ -29,7 +29,12 @@ var keyboard = new function() {
|
||||
this.setSocket = function(ws) {
|
||||
keyboard.releaseAll();
|
||||
__ws = ws;
|
||||
$("hid-keyboard-led").className = (ws ? "led-on" : "led-off");
|
||||
keyboard.updateLeds();
|
||||
};
|
||||
|
||||
this.updateLeds = function() {
|
||||
var focused = (__ws && (document.activeElement === $("stream-window") || document.activeElement === $("keyboard-window")));
|
||||
$("hid-keyboard-led").className = (focused ? "led-on" : "led-off");
|
||||
};
|
||||
|
||||
this.releaseAll = function(ws) {
|
||||
|
||||
Reference in New Issue
Block a user