Component: Keyboard (Controls )

From Flowcode Help
Revision as of 13:04, 7 January 2022 by BenR (talk | contribs) (→‎Examples)
Jump to navigationJump to search
Author Matrix TSL
Version 1.0
Category Controls


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

Detailed description

No detailed description exists yet for this component

Examples

Here is an example of how to use the keyboard component to map key pressed to various functions on the panel.

FC6 Icon.png 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.

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.

KeyboardKeys.jpg


The user can then easily select which key they would like to assign to each function.

Downloadable macro reference

Fc9-comp-macro.png GetKeyPress
Checks a single virtual key code to test if the button is pressed or not. 
Fc9-u8-icon.png - BYTE KeyCode
Virtual Key Code Number 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png 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. 
Fc9-u8-icon.png - BYTE Return



Property reference

Fc9-prop-icon.png Properties
Fc9-type-16-icon.png Number of Scan Keys
Sets the number of keys to scan through when calling the CheckMultipleKeys function. 
Fc9-type-16-icon.png Scan Key 1
Virtual Keycode assigned to the scan index 
Fc9-type-16-icon.png Scan Key 2
Virtual Keycode assigned to the scan index 
Fc9-type-16-icon.png Scan Key 3
Virtual Keycode assigned to the scan index 
Fc9-type-16-icon.png Scan Key 4
Virtual Keycode assigned to the scan index 
Fc9-conn-icon.png Connections
Fc9-conn-icon.png Simulations