mirror of
https://github.com/SeedSigner/seedsigner.git
synced 2026-10-05 15:08:25 +00:00
added continual directional press for letter selection
This commit is contained in:
@@ -1 +1,2 @@
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
|
__pycache__/
|
||||||
|
|||||||
+4
-2
@@ -32,10 +32,12 @@ class Buttons:
|
|||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
def wait_for(self, keys = [], check_release = True) -> int:
|
def wait_for(self, keys = [], check_release = True, release_keys = []) -> int:
|
||||||
|
if not release_keys:
|
||||||
|
release_keys = keys
|
||||||
while True:
|
while True:
|
||||||
for i in keys:
|
for i in keys:
|
||||||
if check_release == False or (check_release == True and B.release_lock == True):
|
if check_release == False or ((check_release == True and i in release_keys and B.release_lock == True) or check_release == True and i not in release_keys):
|
||||||
# when check release is False or the release lock is released (True)
|
# when check release is False or the release lock is released (True)
|
||||||
if self.GPIO.input(i) == GPIO.LOW or self.override_ind == True:
|
if self.GPIO.input(i) == GPIO.LOW or self.override_ind == True:
|
||||||
B.release_lock = False
|
B.release_lock = False
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ class SeedToolsView(View):
|
|||||||
|
|
||||||
# Wait for Button Input (specifically menu selection/press)
|
# Wait for Button Input (specifically menu selection/press)
|
||||||
while True:
|
while True:
|
||||||
input = self.buttons.wait_for([B.KEY_UP, B.KEY_DOWN, B.KEY_PRESS, B.KEY_RIGHT, B.KEY_LEFT, B.KEY1, B.KEY2, B.KEY3])
|
input = self.buttons.wait_for([B.KEY_UP, B.KEY_DOWN, B.KEY_PRESS, B.KEY_RIGHT, B.KEY_LEFT, B.KEY1, B.KEY2, B.KEY3], True, [B.KEY_PRESS, B.KEY_RIGHT, B.KEY_LEFT, B.KEY1, B.KEY2, B.KEY3])
|
||||||
if input == B.KEY_UP:
|
if input == B.KEY_UP:
|
||||||
ret_val = self.gather_words_up()
|
ret_val = self.gather_words_up()
|
||||||
elif input == B.KEY_DOWN:
|
elif input == B.KEY_DOWN:
|
||||||
|
|||||||
Reference in New Issue
Block a user