Disabling User Input

From SIMboxWiki
Revision as of 19:12, 11 March 2013 by Leslie Brown (talk | contribs) (Created page with 'Sometimes a situation arises where it would be convenient to temporarily disable user inputs. For example, if you want the user to enter numbers into a text box using the keypad …')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Sometimes a situation arises where it would be convenient to temporarily disable user inputs. For example, if you want the user to enter numbers into a text box using the keypad without having those inputs interpreted as camera movement commands, you would want to do this. Use the following API calls:

• SimApi::InputDevices::enableUserInput(false) – disable user inputs.
• SimApi::InputDevices::enableUserInput(true) – enable user inputs.

Refer to the code sample below:

void CPaneDialog::OnEnSetfocusEdit1()
{
   SimApi::InputDevices::enableUserInput(false);
}

void CPaneDialog::OnEnKillfocusEdit1()
{
   SimApi::InputDevices::enableUserInput(true);
}