Difference between revisions of "Component: Keyboard (Controls )"

From Flowcode Help
Jump to navigationJump to search
Line 1: Line 1:
 
+
{| style="width:50%"
 
 
{| width="50%"
 
 
|-
 
|-
| width="20%" style="color: gray;" | Author
+
| width="20%" style="color:gray;" | Author
 
| Matrix TSL
 
| Matrix TSL
 
|-
 
|-
| width="20%" style="color: gray;" | Version
+
| width="20%" style="color:gray;" | Version
| 1.0 (Release)
+
| 1.0
 
|-
 
|-
| width="20%" style="color: gray;" | Category
+
| width="20%" style="color:gray;" | Category
 
| Controls  
 
| 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
  
==[[File:Component Icon eb9025a7_acec_455c_9033_bd4dd2586e05.png|Image]] Keyboard component==
+
==Detailed description==
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.
+
''No detailed description exists yet for this component''
  
 +
==Examples==
  
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.
 
Here is an example of how to use the keyboard component to map key pressed to various functions on the panel.
Line 45: Line 43:
 
==Downloadable macro reference==
 
==Downloadable macro reference==
  
''This component does not contain any downloadable macros''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetKeyPress'''
 +
|-
 +
| colspan="2" | Checks a single virtual key code to test if the button is pressed or not. 
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | KeyCode
 +
|-
 +
| colspan="2" | Virtual Key Code Number 
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
==Simulation macro reference==
 
  
===<span style="font-weight: normal;"><u><tt>GetKeyPress</tt></u></span>===
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
Checks a single virtual key code to test if the button is pressed or not.
+
|-
 
+
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
'''Parameters'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CheckMultipleKeys'''
 
+
|-
:[[Variable Types|BYTE]] ''KeyCode''
+
| colspan="2" | 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.&nbsp;
::Virtual Key Code Number
+
|-
 
+
|-
 
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
'''Return value'''
+
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
+
|}
:[[Variable Types|BYTE]]
 
 
 
 
 
===<span style="font-weight: normal;"><u><tt>CheckMultipleKeys</tt></u></span>===
 
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'''
 
 
 
:[[Variable Types|BYTE]]
 
  
  
Line 83: Line 77:
  
 
==Property reference==
 
==Property reference==
<span style="font-weight: normal;"><u>Number of Scan Keys</u></span>
 
  
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''NumKeys''.
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
+
|-
Sets the number of keys to scan through when calling the CheckMultipleKeys function.
+
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
 
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
<span style="font-weight: normal;"><u>Scan Key 1</u></span>
+
|-
 
+
|-
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''ScanKey1''.
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | Number of Scan Keys
Virtual Keycode assigned to the scan index
+
|-
 
+
| colspan="2" | Sets the number of keys to scan through when calling the CheckMultipleKeys function.&nbsp;
<span style="font-weight: normal;"><u>Scan Key 2</u></span>
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''ScanKey2''.
+
| width="90%" | Scan Key 1
 
+
|-
Virtual Keycode assigned to the scan index
+
| colspan="2" | Virtual Keycode assigned to the scan index&nbsp;
 
+
|-
<span style="font-weight: normal;"><u>Scan Key 3</u></span>
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | Scan Key 2
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''ScanKey3''.
+
|-
 
+
| colspan="2" | Virtual Keycode assigned to the scan index&nbsp;
Virtual Keycode assigned to the scan index
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
<span style="font-weight: normal;"><u>Scan Key 4</u></span>
+
| width="90%" | Scan Key 3
 
+
|-
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''ScanKey4''.
+
| colspan="2" | Virtual Keycode assigned to the scan index&nbsp;
 
+
|-
Virtual Keycode assigned to the scan index
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 +
| width="90%" | Scan Key 4
 +
|-
 +
| colspan="2" | Virtual Keycode assigned to the scan index&nbsp;
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Connections'''  
 +
|-
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Simulations'''  
 +
|-
 +
|}

Revision as of 09:19, 21 September 2021

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