Skip to content
Snippets Groups Projects
Verified Commit a8226b95 authored by dos's avatar dos
Browse files

py,st3m: Pressable: Fix "flickering" of .down property with repeat enabled

.down property was returning True only if the pressable was in DOWN state.
This leads to glitches, as because of key repeat it also goes through
REPEATED state while the pressable is being held, going against the
documented behavior. Fix this by considering both DOWN and REPEATED
states when evaluating the property.
parent 2ce81d0b
No related branches found
No related tags found
No related merge requests found
...@@ -252,7 +252,7 @@ class Pressable: ...@@ -252,7 +252,7 @@ class Pressable:
""" """
True if the button is held down, after first being pressed. True if the button is held down, after first being pressed.
""" """
return self.state == self.DOWN return self.state in (self.DOWN, self.REPEATED)
@property @property
def up(self) -> bool: def up(self) -> bool:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment