Class to easily manage user interaction in your FSUIPC application. Key strokes and Button presses can be registered and then detected when the user presses these keys or buttons in the Flight Sim application. Also Menu items can be added to flight sim and you can detect when the user selects them.
More...
|
void | AddKeyPress (string ID, ModifierKeys Modifier, Keys Key, bool PassThroughToFS) |
| Adds a key press to be detected. Sink the KeyPressed event to detect then the user pressed this key.
|
|
void | AddJoystickButtonPress (string ID, byte JoystickNumber, byte ButtonNumber, StateChange StateChangeToDetect) |
| Adds a joystick button press to be detected. Sink the ButtonPressed event to detect then the user pressed this button.
|
|
void | AddMenuItem (string ID, string MenuText, bool PauseFSOnSelection) |
| Adds a menu item to the Flight Sim menu. Sink the MenuSelected event to detect then the user selects this menu item.
|
|
void | AddSubMenuItem (string ID, string ParentMenuID, string MenuText) |
| Adds a sub-menu item to the Flight Sim menu. FSX/ESP/P3D and later ONLY.
|
|
void | CheckForInput () |
| Call this method regularly to check if the user has pressed any key or button or has selected a menu item. FSUIPC documentation recommends every 200ms.
|
|
void | KeepMenuItemsAlive () |
| Call this method to keep the menu items alive. The FSUIPC documentation recommends every 5-10 seconds. All menu items will time-out and be removed after approx. 14 seconds if this is not called.
|
|
void | RemoveKeyPress (string ID) |
| Cancels and removes a key press.
|
|
void | RemoveJoystickButtonPress (string ID) |
| Cancels and removes a joystick button press.
|
|
void | RemoveMenuItem (string ID) |
| Cancels and removes a menu item.
|
|
void | RemoveAll () |
| Cancels and removes all key presses, button presses and menu items. It is recommended that you call this method before your application exits.
|
|
|
EventHandler< UserInputKeyEventArgs > | KeyPressed |
| This event is raised when one of the registered keys is pressed.
|
|
EventHandler< UserInputButtonEventArgs > | ButtonPressed |
| This event is raised when one of the registered joystick buttons is pressed.
|
|
EventHandler< UserInputMenuEventArgs > | MenuSelected |
| This event is raised when one of the menu items is selected.
|
|
Class to easily manage user interaction in your FSUIPC application. Key strokes and Button presses can be registered and then detected when the user presses these keys or buttons in the Flight Sim application. Also Menu items can be added to flight sim and you can detect when the user selects them.
◆ AddJoystickButtonPress()
void AddJoystickButtonPress |
( |
string | ID, |
|
|
byte | JoystickNumber, |
|
|
byte | ButtonNumber, |
|
|
StateChange | StateChangeToDetect ) |
|
inline |
Adds a joystick button press to be detected. Sink the ButtonPressed event to detect then the user pressed this button.
- Parameters
-
ID | A string that you will use to identity and detect this button press. |
JoystickNumber | The number of the Joystick (0-15) to detect. |
ButtonNumber | The number of the Button to detect. |
StateChangeToDetect | Which states to detect. |
◆ AddKeyPress()
void AddKeyPress |
( |
string | ID, |
|
|
ModifierKeys | Modifier, |
|
|
Keys | Key, |
|
|
bool | PassThroughToFS ) |
|
inline |
Adds a key press to be detected. Sink the KeyPressed event to detect then the user pressed this key.
- Parameters
-
ID | A string that you will use to identity and detect this key press. |
Modifier | Any modifier keys that you want to be held when the main key is pressed. These modifiers can be combined with a bitwise OR. |
Key | The key to be pressed. |
PassThroughToFS | If true, the keypress will also be passed to Flight Sim. If false, the keypress will not be passed on to Flight Sim. |
◆ AddMenuItem()
void AddMenuItem |
( |
string | ID, |
|
|
string | MenuText, |
|
|
bool | PauseFSOnSelection ) |
|
inline |
Adds a menu item to the Flight Sim menu. Sink the MenuSelected event to detect then the user selects this menu item.
- Parameters
-
ID | A string that you will use to identity and detect this menu item. |
- Parameters
-
MenuText | The text to display in the Flight Sim menu. A short-cut letter can be marked by prefixing it with an ampersand (&). |
PauseFSOnSelection | Set to true if you want Flight Sim to pause after this menu item is selected. You will need to unpause Flight Sim in your application when ready to continue. |
◆ AddSubMenuItem()
void AddSubMenuItem |
( |
string | ID, |
|
|
string | ParentMenuID, |
|
|
string | MenuText ) |
|
inline |
Adds a sub-menu item to the Flight Sim menu. FSX/ESP/P3D and later ONLY.
Note that the Pause On Selection can be set on the Parent Menu only and applied to all sub menus.
Only one level of sub menus are supported.
- Parameters
-
ID | A string that you will use to identity and detect this menu item. |
- Parameters
-
ParentMenuID | The ID of the main menu item that this new menu will be place under. |
This cannot be another sub menu.
- Parameters
-
MenuText | The text to display in the Flight Sim menu. A short-cut letter can be marked by prefixing it with an ampersand (&). |
◆ RemoveJoystickButtonPress()
void RemoveJoystickButtonPress |
( |
string | ID | ) |
|
|
inline |
Cancels and removes a joystick button press.
- Parameters
-
ID | The ID of the button press to cancel/remove |
◆ RemoveKeyPress()
void RemoveKeyPress |
( |
string | ID | ) |
|
|
inline |
Cancels and removes a key press.
- Parameters
-
ID | The ID of the key press to cancel/remove |
◆ RemoveMenuItem()
void RemoveMenuItem |
( |
string | ID | ) |
|
|
inline |
Cancels and removes a menu item.
- Parameters
-
ID | The ID of the menu item to cancel/remove |