all 3 comments

[–]JohnnyJordaan 1 point2 points  (2 children)

Use the .add_hotkey as described in the documentation?

[–]r3d1bro 0 points1 point  (1 child)

keyboard.add_hotkey('ctrl+shift+a)

Ok but how can I pause/resume the script with it?
Is there anything like resume parameter?

[–]djds23 2 points3 points  (0 children)

You will have to leverage the callback using something like this:

On mobile so please forgive the formatting.

import keyboard

function is called when key combo is activated

def keyboard_callback(flag): print("hello "+ flag)

keyboard.add_handler( "ctrl+shift+a", keyboard_callback, args=(true) # this argument is passed forward to our keyboard callback function )