Skip to content

Commit c6d07c8

Browse files
committed
Add properties for button pressed state
1 parent 51e1b09 commit c6d07c8

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/modulino/buttons.py

+13-1
Original file line numberDiff line numberDiff line change
@@ -165,4 +165,16 @@ def update(self):
165165
return button_states_changed
166166

167167
def is_pressed(self, index):
168-
return self._current_buttons_status[index]
168+
return self._current_buttons_status[index]
169+
170+
@property
171+
def button_a_pressed(self):
172+
return self.is_pressed(0)
173+
174+
@property
175+
def button_b_pressed(self):
176+
return self.is_pressed(1)
177+
178+
@property
179+
def button_c_pressed(self):
180+
return self.is_pressed(2)

0 commit comments

Comments
 (0)