mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 17:20:30 +08:00
Fixed pikvm/pikvm#307: mute hid switch
This commit is contained in:
parent
ac109043ed
commit
cd80286414
@ -206,6 +206,16 @@
|
||||
</td>
|
||||
</table>
|
||||
</div>
|
||||
<hr>
|
||||
<table class="kv">
|
||||
<td>Mute HID input events:</td>
|
||||
<td align="right">
|
||||
<div class="switch-box">
|
||||
<input type="checkbox" id="hid-mute-switch">
|
||||
<label for="hid-mute-switch"><span class="switch-inner"></span><span class="switch"></span></label>
|
||||
</div>
|
||||
</td>
|
||||
</table>
|
||||
<hr>
|
||||
<div class="feature-disabled" id="v3-usb-breaker">
|
||||
<table class="kv">
|
||||
|
||||
@ -55,6 +55,8 @@ li(class="right")
|
||||
hr
|
||||
+menu_switch("hid-connect-switch", "Connect HID to Server", true, true)
|
||||
hr
|
||||
+menu_switch("hid-mute-switch", "Mute HID input events", true, false)
|
||||
hr
|
||||
div(id="v3-usb-breaker" class="feature-disabled")
|
||||
table(class="kv")
|
||||
td Connect main USB to Server:
|
||||
|
||||
@ -149,7 +149,7 @@ export function Keyboard(record_callback) {
|
||||
"event_type": "key",
|
||||
"event": {"key": code, "state": state},
|
||||
};
|
||||
if (__ws) {
|
||||
if (__ws && !$("hid-mute-switch").checked) {
|
||||
__ws.send(JSON.stringify(event));
|
||||
}
|
||||
__record_callback(event);
|
||||
|
||||
@ -301,7 +301,7 @@ export function Mouse(get_resolution_callback, record_callback) {
|
||||
|
||||
var __sendEvent = function(event_type, event) {
|
||||
event = {"event_type": event_type, "event": event};
|
||||
if (__ws) {
|
||||
if (__ws && !$("hid-mute-switch").checked) {
|
||||
__ws.send(JSON.stringify(event));
|
||||
}
|
||||
__record_callback(event);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user