diff options
author | tomaszduda23 <[email protected]> | 2022-07-08 21:58:14 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2022-07-08 22:58:14 +0300 |
commit | e864aafcf7f9dea75582c1ebcbca5e8ac1a1ae26 (patch) | |
tree | a0363f589686f86f205c755316b96a01493634e7 /hid/src/main.cpp | |
parent | b4c1cc9976052dbefc30826c61aacf89fdf501b2 (diff) |
Change name to simplify interface getLedsAs->getLeds. (#93)
Diffstat (limited to 'hid/src/main.cpp')
-rw-r--r-- | hid/src/main.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/hid/src/main.cpp b/hid/src/main.cpp index 162636ab..7d575b54 100644 --- a/hid/src/main.cpp +++ b/hid/src/main.cpp @@ -285,11 +285,17 @@ static void _sendResponse(uint8_t code) { # endif if (_usb_kbd) { response[1] |= _usb_kbd->isOffline() ? PROTO::PONG::KEYBOARD_OFFLINE : 0; - response[1] |= _usb_kbd->getLedsAs(PROTO::PONG::CAPS, PROTO::PONG::SCROLL, PROTO::PONG::NUM); + KeyboardLedsState leds = _usb_kbd->getLeds(); + response[1] |= leds.caps ? PROTO::PONG::CAPS : 0; + response[1] |= leds.num ? PROTO::PONG::NUM : 0; + response[1] |= leds.scroll ? PROTO::PONG::SCROLL : 0; response[2] |= PROTO::OUTPUTS1::KEYBOARD::USB; } else if (_ps2_kbd) { response[1] |= _ps2_kbd->isOffline() ? PROTO::PONG::KEYBOARD_OFFLINE : 0; - response[1] |= _ps2_kbd->getLedsAs(PROTO::PONG::CAPS, PROTO::PONG::SCROLL, PROTO::PONG::NUM); + KeyboardLedsState leds = _usb_kbd->getLeds(); + response[1] |= leds.caps ? PROTO::PONG::CAPS : 0; + response[1] |= leds.num ? PROTO::PONG::NUM : 0; + response[1] |= leds.scroll ? PROTO::PONG::SCROLL : 0; response[2] |= PROTO::OUTPUTS1::KEYBOARD::PS2; } if (_usb_mouse_abs) { |