-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathLeftAndRight.py
More file actions
22 lines (21 loc) · 868 Bytes
/
LeftAndRight.py
File metadata and controls
22 lines (21 loc) · 868 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
class LeftAndRight:
def __init__(self):
self.right_up_with_left_down_done = False
self.left_up_with_right_down_done = False
def LeftAndRightPressed(self, event):
# returns left_and_right_pressed, event_used
if event.LeftUp():
if self.right_up_with_left_down_done:
self.right_up_with_left_down_done = False
return True, True
elif event.rightDown:
self.left_up_with_right_down_done = True
return False, True
elif event.RightUp():
if self.left_up_with_right_down_done:
self.left_up_with_right_down_done = False
return True, True
elif event.leftDown:
self.right_up_with_left_down_done = True
return False, True
return False, False