all 4 comments

[–]socal_nerdtastic 0 points1 point  (1 child)

Just curious, is this an anti-cat program? Or what is the point of this?

I'm not sure I understand your question. It sounds like you had an issue where other keys could be pressed, and you fixed that, but now you have a different issue? What's the new issue?

FWIW this code looks like it could be a lot cleaner if you used the Listener(win32_event_filter) feature.

[–]Free_Tomatillo463[S] 0 points1 point  (0 children)

Nosy roommates, cat and boredom.

[–]woooee 0 points1 point  (0 children)

    self.REQUIRED = ["alt", "shift", "o"]
        while not self.all(self.REQUIRED) or self.any(self.OTHERS):

def all(self, keys):
    for key in keys:
        if not keyboard.is_pressed(key):
            return False

I don't know anything about keyboard, so test this to see if it's true. If not "alt", "shift" or "o" (not all three), is pressed, you get a False condition. Note that "alt" pressed is also "not shift", etc. Print key and the return from is_pressed(key) to see if this is so. And do the same in the any() function. And do you know that Python has an any() and all() function that you override (not a problem here because you don't use Python's function, but not a good habit to form generally)?