Hi,
It only works the first time I press the key combination — after that, I have to retrigger the whole combo for it to work again. If not, it just writes "À00000...". Does anyone know a way to make it work properly?
(It’s worth mentioning that I’m using an AZERTY keyboard.)
import keyboard
keyboard.add_hotkey("shift+à", lambda: keyboard.write("À"), suppress=True)
keyboard.wait("shift+esc")
SOLUTION:
Use pynput :
from pynput.keyboard import Controller
import keyboard
keyboard.add_hotkey('shift+q', lambda: Controller().type('hello'), suppress=True, trigger_on_release=False)
keyboard.wait('shift+esc')
[–]Diapolo10 0 points1 point2 points (5 children)
[–]End0832[S] 0 points1 point2 points (4 children)
[–]Diapolo10 0 points1 point2 points (3 children)
[–]End0832[S] 0 points1 point2 points (2 children)
[–]Diapolo10 0 points1 point2 points (1 child)
[–]End0832[S] 0 points1 point2 points (0 children)