Difference between revisions of "Component: Keyboard (Controls )"
Line 28: | Line 28: | ||
{{Fcfile|KeyboardExample.fcsx|Keyboard Example}} | {{Fcfile|KeyboardExample.fcsx|Keyboard Example}} | ||
+ | |||
+ | |||
+ | You can define keys that can be changed by the user by right clicking the keys in the keyboard component property and exposing them to the top level. | ||
+ | |||
+ | [[File:KeyboardExpose.jpg]] | ||
+ | |||
+ | |||
+ | Once the properties have been exposed you can double click the top level property and rename to give a meaningful name in your application. | ||
+ | |||
+ | [[File:KeyboardKeys.jpg]] | ||
+ | |||
+ | |||
+ | The user can then select which key they would like to assign to this function. | ||
Revision as of 13:47, 3 November 2020
Author | Matrix TSL |
Version | 1.0 (Release) |
Category | Controls |
Contents
Keyboard component
Component to allow you to get direct input from the keyboard.
Specific keys can be polled to test if they are pressed and provide interaction with the runtime panel.
A full list of virtual key codes can be found here: https://docs.microsoft.com/en-gb/windows/win32/inputdev/virtual-key-codes?redirectedfrom=MSDN
Examples
Here is an example of how to use the keyboard component to map key pressed to various functions on the panel.
You can define keys that can be changed by the user by right clicking the keys in the keyboard component property and exposing them to the top level.
Once the properties have been exposed you can double click the top level property and rename to give a meaningful name in your application.
The user can then select which key they would like to assign to this function.
Downloadable macro reference
This component does not contain any downloadable macros
Simulation macro reference
GetKeyPress
Checks a single virtual key code to test if the button is pressed or not.
Parameters
- BYTE KeyCode
- Virtual Key Code Number
Return value
CheckMultipleKeys
Checks all of the keys enabled in the component properties.
If any keys are pressed then their scan index number is returned.
If no keys are pressed then 0 is returned.
Parameters
- This macro has no parameters
Return value
Property reference
Number of Scan Keys
This property is of type Fixed list of ints and can be referenced with the variable name NumKeys.
Sets the number of keys to scan through when calling the CheckMultipleKeys function.
Scan Key 1
This property is of type Fixed list of ints and can be referenced with the variable name ScanKey1.
Virtual Keycode assigned to the scan index
Scan Key 2
This property is of type Fixed list of ints and can be referenced with the variable name ScanKey2.
Virtual Keycode assigned to the scan index
Scan Key 3
This property is of type Fixed list of ints and can be referenced with the variable name ScanKey3.
Virtual Keycode assigned to the scan index
Scan Key 4
This property is of type Fixed list of ints and can be referenced with the variable name ScanKey4.
Virtual Keycode assigned to the scan index