Jump to content
The simFlight Network Forums

Return a value to event.key()?


ark1320

Recommended Posts

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

Link to comment
Share on other sites

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

  • Like 1
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.