keyboard
keyboard copied to clipboard
Code mutes my speaker volume for no reason
def key_pressed():
keyboard.add_hotkey('del', pressed_del)
keyboard.wait()
def pressed_del():
keyboard.send('shift')
time.sleep(0.15)
keyboard.send('a')
time.sleep(0.15)
keyboard.send('shift')
time.sleep(0.1)
keyboard.send('s')
for x in range(0, 10):
keyboard.send('d')
time.sleep(0.09)
if __name__ == '__main__':
key_pressed()
When i press delete the code executes but in addition my speaker gets muted and unmuted rapidly, probably for every loop iteration. tested in both pc and laptop and same happened.
Try run the script after switching the layout to English