Skip to content

Commit 0d63b9f

Browse files
committed
pbio/platform/animation: Draw numpad keys.
1 parent f1f79e5 commit 0d63b9f

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

lib/pbio/platform/virtual_hub/animation.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,15 @@ def load_and_scale_image(filename, scale=0.25):
175175
)
176176
screen.blit(scaled_surface, DISPLAY_POS)
177177

178+
# Draw red circles for pressed numpad keys, positioned as on a numpad
179+
for i in range(1, 10):
180+
if numpad_state & (1 << i):
181+
dx = -1 if i in (1, 4, 7) else 1 if i in (9, 6, 3) else 0
182+
dy = -1 if i in (7, 8, 9) else 1 if i in (1, 2, 3) else 0
183+
x = 595 + dx * 52
184+
y = 694 + dy * 52
185+
pygame.draw.circle(screen, (140, 20, 20), (x, y), 20)
186+
178187
# Update display
179188
pygame.display.flip()
180189
clock.tick(FPS)

0 commit comments

Comments
 (0)