summaryrefslogtreecommitdiff
path: root/kvmd/plugins/hid/_mcu
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2021-08-15 17:34:42 +0300
committerMaxim Devaev <[email protected]>2021-08-15 20:16:48 +0300
commitdf098bd075e26fb6ecc75b2f7be5923371741677 (patch)
tree663a4e6a4808ed267e985c5b5d3d18bc4cf1f915 /kvmd/plugins/hid/_mcu
parent9afa6efbe4b8ee3186c5d840233c96115363460f (diff)
win95 runtime switching
Diffstat (limited to 'kvmd/plugins/hid/_mcu')
-rw-r--r--kvmd/plugins/hid/_mcu/__init__.py17
-rw-r--r--kvmd/plugins/hid/_mcu/proto.py9
2 files changed, 18 insertions, 8 deletions
diff --git a/kvmd/plugins/hid/_mcu/__init__.py b/kvmd/plugins/hid/_mcu/__init__.py
index 07aeface..4dfd978a 100644
--- a/kvmd/plugins/hid/_mcu/__init__.py
+++ b/kvmd/plugins/hid/_mcu/__init__.py
@@ -179,12 +179,21 @@ class BaseMcuHid(BaseHid, multiprocessing.Process): # pylint: disable=too-many-
if outputs1 & 0b10000000: # Dynamic
if outputs2 & 0b00000001: # USB
- keyboard_outputs["available"].extend(["usb", "disabled"])
- mouse_outputs["available"].extend(["usb", "usb_rel", "disabled"])
+ keyboard_outputs["available"].append("usb")
+ mouse_outputs["available"].extend(["usb", "usb_rel"])
+
+ if outputs2 & 0b00000100: # USB WIN98
+ mouse_outputs["available"].append("usb_win98")
if outputs2 & 0b00000010: # PS/2
- keyboard_outputs["available"].extend(["ps2", "disabled"])
- mouse_outputs["available"].extend(["ps2", "disabled"])
+ keyboard_outputs["available"].append("ps2")
+ mouse_outputs["available"].append("ps2")
+
+ if keyboard_outputs["available"]:
+ keyboard_outputs["available"].append("disabled")
+
+ if mouse_outputs["available"]:
+ mouse_outputs["available"].append("disabled")
active_keyboard = get_active_keyboard(outputs1)
if active_keyboard in keyboard_outputs["available"]:
diff --git a/kvmd/plugins/hid/_mcu/proto.py b/kvmd/plugins/hid/_mcu/proto.py
index 16757d7d..a49f2b02 100644
--- a/kvmd/plugins/hid/_mcu/proto.py
+++ b/kvmd/plugins/hid/_mcu/proto.py
@@ -63,10 +63,11 @@ class SetKeyboardOutputEvent(BaseEvent):
# =====
_MOUSE_NAMES_TO_CODES = {
- "disabled": 0b00000000,
- "usb": 0b00001000,
- "usb_rel": 0b00010000,
- "ps2": 0b00011000,
+ "disabled": 0b00000000,
+ "usb": 0b00001000,
+ "usb_rel": 0b00010000,
+ "ps2": 0b00011000,
+ "usb_win98": 0b00100000,
}
_MOUSE_CODES_TO_NAMES = tools.swapped_kvs(_MOUSE_NAMES_TO_CODES)