Fixed pikvm/pikvm#307: mute hid switch

This commit is contained in:
Devaev Maxim
2021-05-19 09:11:44 +03:00
parent ac109043ed
commit cd80286414
4 changed files with 14 additions and 2 deletions

View File

@@ -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);

View File

@@ -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);