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
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now