fix KC["_"] resolving to BLE_REFRESH

This commit is contained in:
xs5871 2022-07-02 08:08:59 +00:00 committed by Kyle Brown
parent 03d5f7ae10
commit 357165c14b
2 changed files with 4 additions and 1 deletions

View File

@ -189,7 +189,7 @@ class KeyAttrDict:
)
elif key in ('HID_SWITCH', 'HID'):
make_key(names=('HID_SWITCH', 'HID'), on_press=handlers.hid_switch)
elif key in ('BLE_REFRESH'):
elif key in ('BLE_REFRESH',):
make_key(names=('BLE_REFRESH',), on_press=handlers.ble_refresh)
else:
maybe_key = first_truthy(

View File

@ -239,6 +239,9 @@ class TestKeys_get(unittest.TestCase):
created = make_key(names=('ThIs_Is_A_StRaNgE_kEy',))
assert created is KC.get('ThIs_Is_A_StRaNgE_kEy')
def test_underscore(self):
assert KC.get('_')
# Some of these test appear silly, but they're testing we get the
# same, single, instance back when requested through KC and that