@@ -21,8 +21,6 @@ def __init__(self):
21
21
self .joystick : Union [Joystick , None ] = None
22
22
23
23
self .terminated : bool = False
24
- self .last_rb_clicked : bool = False
25
- self .last_lb_clicked : bool = False
26
24
27
25
self .last_left_clicked : bool = False
28
26
self .last_right_clicked : bool = False
@@ -34,9 +32,6 @@ def __init__(self):
34
32
self .last_dpad_up_clicked : bool = False
35
33
self .last_dpad_down_clicked : bool = False
36
34
37
- self .last_apply_clicked : bool = False
38
- self .last_back_clicked : bool = False
39
-
40
35
self .lb_clicked : () = lambda : None
41
36
self .rb_clicked : () = lambda : None
42
37
self .l_clicked : () = lambda : None
@@ -82,36 +77,18 @@ def cycle(self):
82
77
self .joystick = joysticks [self .joystick .get_instance_id ()]
83
78
84
79
# LB
85
- if event .button == self .LB_BUTTON and not self .last_lb_clicked :
86
- self .last_lb_clicked = not self .last_lb_clicked
80
+ if event .button == self .LB_BUTTON :
87
81
self .lb_clicked ()
88
82
# RB
89
- if event .button == self .RB_BUTTON and not self .last_rb_clicked :
90
- self .last_rb_clicked = not self .last_rb_clicked
83
+ if event .button == self .RB_BUTTON :
91
84
self .rb_clicked ()
92
85
# APPLY
93
- if event .button == self .APPLY_BUTTON and not self .last_apply_clicked :
94
- self .last_apply_clicked = not self .last_apply_clicked
86
+ if event .button == self .APPLY_BUTTON :
95
87
self .apply_clicked ()
96
88
# BACK
97
- if event .button == self .BACK_BUTTON and not self .last_back_clicked :
98
- self .last_back_clicked = not self .last_back_clicked
89
+ if event .button == self .BACK_BUTTON :
99
90
self .back_clicked ()
100
91
101
- if event .type == pygame .JOYBUTTONUP :
102
- # LB
103
- if event .button == self .LB_BUTTON and self .last_lb_clicked :
104
- self .last_lb_clicked = not self .last_lb_clicked
105
- # RB
106
- if event .button == self .RB_BUTTON and not self .last_rb_clicked :
107
- self .last_rb_clicked = not self .last_rb_clicked
108
- # APPLY
109
- if event .button == self .APPLY_BUTTON and not self .last_apply_clicked :
110
- self .last_apply_clicked = not self .last_apply_clicked
111
- # BACK
112
- if event .button == self .BACK_BUTTON and not self .last_back_clicked :
113
- self .last_back_clicked = not self .last_back_clicked
114
-
115
92
if event .type == pygame .JOYAXISMOTION :
116
93
self .joystick = joysticks [event .instance_id ]
117
94
left_right_axis = self .joystick .get_axis (self .LEFT_RIGHT_AXIS )
0 commit comments