From 1ab6d97ea276d737102ff952fa084b6cd5e55684 Mon Sep 17 00:00:00 2001 From: Andreblue Date: Sun, 25 Jul 2021 10:51:35 -0400 Subject: [PATCH 1/2] Added hidden F codes --- adafruit_hid/keycode.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/adafruit_hid/keycode.py b/adafruit_hid/keycode.py index 14ab81e..52c912f 100644 --- a/adafruit_hid/keycode.py +++ b/adafruit_hid/keycode.py @@ -254,6 +254,17 @@ class Keycode: """Function key F18 (Mac)""" F19 = 0x6E """Function key F19 (Mac)""" + + F20 = 0x6F + """Function key F20""" + F21 = 0x70 + """Function key F21""" + F22 = 0x71 + """Function key F22""" + F23 = 0x72 + """Function key F23""" + F24 = 0x73 + """Function key F24""" LEFT_CONTROL = 0xE0 """Control modifier left of the spacebar""" From 45a7afc1f0734b1af160a6bd7de1a6d578f71942 Mon Sep 17 00:00:00 2001 From: Andreblue Date: Sun, 25 Jul 2021 13:53:04 -0400 Subject: [PATCH 2/2] Ran formatting command --- adafruit_hid/keycode.py | 2 +- examples/gamepad.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/adafruit_hid/keycode.py b/adafruit_hid/keycode.py index 52c912f..a4531f4 100644 --- a/adafruit_hid/keycode.py +++ b/adafruit_hid/keycode.py @@ -254,7 +254,7 @@ class Keycode: """Function key F18 (Mac)""" F19 = 0x6E """Function key F19 (Mac)""" - + F20 = 0x6F """Function key F20""" F21 = 0x70 diff --git a/examples/gamepad.py b/examples/gamepad.py index ff496c3..01a9653 100644 --- a/examples/gamepad.py +++ b/examples/gamepad.py @@ -65,13 +65,13 @@ def __init__(self, devices): self.reset_all() def press_buttons(self, *buttons): - """Press and hold the given buttons. """ + """Press and hold the given buttons.""" for button in buttons: self._buttons_state |= 1 << self._validate_button_number(button) - 1 self._send() def release_buttons(self, *buttons): - """Release the given buttons. """ + """Release the given buttons.""" for button in buttons: self._buttons_state &= ~(1 << self._validate_button_number(button) - 1) self._send()