UpsilonNumworks / Upsilon

Upsilon, an OS forked from Omega for your Numworks calculator
https://getupsilon.web.app/
Other
201 stars 58 forks source link

Add more functions by default to Ion in Python #354

Open PetitFrapo opened 9 months ago

PetitFrapo commented 9 months ago

Is your feature request related to a problem? Please describe. Each time I use Ion to make Python programs I always stumble into the issue of half presses or waiting for full press, so I find myself needing to program key_pressed() and key_half_pressed() functions, and I think they should be implemented, because a simple keydown doesn't cut it for some situations, makes UIs way too sensitive.

Describe the solution you'd like Implement in Ion by default the key_pressed(k) and key_half_pressed(k) functions. The former immediately returns False if the key is not down and if the key is down, it waits until it's unheld to return True. The latter is a bit harder to implement, but the idea is that once the key is pressed it returns True but it shouldn't return True again as long as the key is still held, which prevents actions on the same key to happen each frame, but while not needing to wait to un-hold it. (I also think that get_keys() should not return strings of the keys themselves, but more like "KEY_EXP", "KEY_EXE", etc...) If you have any further questions about the functions I mentioned, feel free to ask for clarification.