how do i get keyboard included in a repl
without using from keyboard import
Answered by Wumi4 [earned 5 cycles]
Just import them as usual!
# The example from the official documentation import keyboard keyboard.press_and_release('shift+s, space') keyboard.write('The quick brown fox jumps over the lazy dog.') keyboard.add_hotkey('ctrl+shift+a', print, args=('triggered', 'hotkey')) # Press PAGE UP then PAGE DOWN to type "foobar". keyboard.add_hotkey('page up, page down', lambda: keyboard.write('foobar')) # Blocks until you press ESC. keyboard.wait('esc') # Record events until 'ESC' is pressed. recorded = keyboard.record(until='esc') # Then replay back at three times the speed. keyboard.play(recorded, speed_factor=3) # Type @@ then press space to replace with abbreviation. keyboard.add_abbreviation('@@', '[email protected]') # Block forever, like `while True`. keyboard.wait()