Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Onkey press/ keyboard inputs for Scene/pygame
-
I have been working around to making things in python for a while now but it seems like something always pops up and gets in the way. Well I recently got an ipad and with it being so versatile I have more opportunities to mess around which brings me to my question, I use my ipad more as a laptop using a keyboard for inputs unless I’m drawing, is there a way to use a (Bluetooth) keyboards inputs as an event, meaning like onkey press space bar y += 10 kind of thing
-
See
https://forum.omz-software.com/topic/6514/hardware-keyboard-input-when-scene-is-runningI believe this works for most keys,
See docs for View.get_key_commands() and
View.key_command(sender) in how to define the keys and respond to them.For instance you can use Arrow keys, return, and most keys. I don't think you can use tab, and can't use modifiers as keys -- like you can't use Ctrl or alt or shift on it's own, but you could use it as a modifier. (E.g shift arrow key can behave different than arrow, but you can't use shift as the fire button)