ark1320 Posted May 13, 2022 Report Posted May 13, 2022 Can a value be returned from a function called by an event in a manner similar to a "regularly" called function? For example, if I have event.key(keycode, 0, "keypressed") can a value be returned from keypressed()? I have tried value_returned = event.key(keycode, 0, "keypressed") but that doesn't seem to work. Thanks, Al
John Dowson Posted May 13, 2022 Report Posted May 13, 2022 12 minutes ago, ark1320 said: Can a value be returned from a function called by an event in a manner similar to a "regularly" called function? For example, if I have event.key(keycode, 0, "keypressed") can a value be returned from keypressed()? I have tried value_returned = event.key(keycode, 0, "keypressed") but that doesn't seem to work. I think you are misunderstanding what the event functions do... they register a function to be called when the event occurs - the actual event.key functions registers the event and returns straight away. The handling function is called when the event occurs - it could return a value but there is no point as there is nothing to handle the returned value (except the thread...). John 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now