diff --git a/boards/default_src/micropython_esp32c2/origin/build/lib/mini_bot.py b/boards/default_src/micropython_esp32c2/origin/build/lib/mini_bot.py index e4adeac6..1eceecd5 100644 --- a/boards/default_src/micropython_esp32c2/origin/build/lib/mini_bot.py +++ b/boards/default_src/micropython_esp32c2/origin/build/lib/mini_bot.py @@ -21,6 +21,7 @@ _BOT035_PGA = const(0x20) _BOT035_KB = const(0x1C) _BOT035_MS = const(0x20) _BOT035_STR = const(0x24) +_BOT035_STA = const(0x25) _FONT_W = const(5) _FONT_H = const(8) _LEDS_W = const(12) @@ -316,6 +317,10 @@ class BOT035(FrameBuffer): else: print("Warning: Please upgrade the coprocessor firmware to use this feature") + def hid_keyboard_state(self): + state = self._rreg(_BOT035_STA) + return bool(state & 0x10), bool(state & 0x20), bool(state & 0x40) + def hid_mouse(self, keys=0, move=(0, 0), wheel=0, release=True): if self._version: self._i2c.writeto_mem(_BOT035_ADDRESS, _BOT035_MS, bytes([keys & 0x0F, move[0] & 0xFF, move[1] & 0xFF, wheel & 0xFF]))