You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
774 B

#!/usr/bin/env python3
from .keyboard import Keyboard
from .color import Color
from .keymap import Keymap
keyboard = Keyboard(no_keymap=False)
if not keyboard.found_keyboard():
print("No keyboard was found")
exit()
def sort_dict(dictionary):
return {k: v for k, v in sorted(dictionary.items(), key=lambda item: item[1])}
def iter_keys(keymap):
sorted_keys = sort_dict(keymap.keys)
for key in sorted_keys.keys():
keyboard.clear()
print(f'key: {key}')
keyboard.set_keys(Color(255, 255, 255), key)
keyboard.draw()
input()
keymap = keyboard.keymap
while True:
keyboard.set_keys(Color(255, 255, 255), list(keymap.keys.keys()))
keyboard.draw()
input("Press Enter to continue...")
iter_keys(keymap)