I am trying to block all keys on the keyboard except for the caps locks key using pyHook. Below is code that blocks only the a and A key, I am looking to do the opposite. What do I need to do to reverse this?
I have tried to put all keys on keyboard beside caps but that seems like the wrong way to approach it
def OnKeyboardEvent(event):
# block only the letter A, lower and uppercase
return (event.Ascii not in (ord('a'), ord('A')))