InputReceiver
Last updated
Was this helpful?
Last updated
Was this helpful?
The InputReceiver property can be assigned to set the current . The current IInputReceiver can receive keyboard input and has an ever-frame method raised for processing input. This property can be used to prevent multiple objects from receiving keyboard input. This is useful if multiple game objects respond to keyboard input - such as a a text box and a character in a platformer.
For a detailed discussion of using the InputReceiver property, see the page.
The InputReceiver can be assigned through custom code. For example, the following might be an event executed when a button is clicked:
The InputReciever property can be checked to see if any control is receiving input. For example, the following code runs hotkey activity if there is no InputReceiver: