print coordinates in interactive mode

Signed-off-by: Thomas Schmid <tom@lfence.de>
This commit is contained in:
Thomas 2021-07-27 22:43:16 +02:00
parent 43aa5630c9
commit 05af5d85ef
1 changed files with 6 additions and 0 deletions

View File

@ -69,15 +69,21 @@ def interactive(an, config):
set_color(an, 0x100)
print_pos = lambda x,y: print(f"x:{x} y:{y}")
while True:
if keyboard.is_pressed("w"):
x = x + 1
print_pos(x,y)
if keyboard.is_pressed("s"):
x = x - 1
print_pos(x,y)
if keyboard.is_pressed("a"):
y = y - 1
print_pos(x,y)
if keyboard.is_pressed("d"):
y = y + 1
print_pos(x,y)
set_pos(an, (x, y))
time.sleep(0.05)