So I have an interesting situation.
Observe this code:
while 1:
lucia.process_events()
if self._handle_arrows():
#logic...
#Here is handle_arrows function, or at least it's semi sudo code
def _handle_arrows(self):
if lucia.key_pressed(lucia.K_UP):
#key logic
if lucia.key_pressed(lucia.K_DOWN):
#key logic
else:
return
The strange part about this code is that it works correctly only after an arrow key has been pressed at least once. Hell, it works fine even if I press some random key like tab or even switch out of the window.
My driver code does the following:
1. import lucia and the loop file
2. make lucia show a window
3. Run the loop code
Ideas? I am really confused, especially if I make the code break and rerun itself, it handles my key inputs just fine. It also works, like I said, after it loses one key event.