Jump to content

Editing Key Mappings: Difference between revisions

From Flowcode Help
ReeceL (talk | contribs)
No edit summary
No edit summary
 
(16 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<sidebar>Sidebar: What Is an Interrupt?</sidebar>
[[File:Gen_Edit_Menu_Key_Mappings.png|right]]
[[File:Gen_Edit_Menu_Key_Mappings.png|right|frameless]]
Key mappings allow you to use the keyboard keys 0 to 9 or A to Z to control components attached to the microcontroller. For example if you have a bank of 8 push switches connected to the microcontroller, you could map the keys 1 to 8 to mimic the pushing and releasing of these switches when the flowchart is simulated.
Key mappings allow you to use the keyboard keys 0 to 9 to control components attached to the microcontroller. For example if you have a bank of 8 push switches connected to the microcontroller, you could map the keys 1 to 8 to mimic the pushing and releasing of these switches when the flowchart is simulated.




To set up or change key mappings, select the Key Mappings option from the Edit menu (Edit > Key Mappings...). For each numeric key, you can select a component and for each component, you can select the individual element that you wish to control with that key. For example if you wish to use the '0' key to control the 5th switch in a component named 'Switches1' then select 'Switches1' in the Component list for Key 0 and then select 5 in the Element list for Key 0.
To set up or change key mappings, select the Key Mappings option from the Edit menu (Edit > Key Mappings...). For each key you can either enter an expression


[[File:Gen_Editing_Key_Mappings_01.png|left]]
'''Eg. Count = Count + 1'''
 
Or enter the name of a user macro and the keyboard key within brackets and the  [[Macro_Icon_Properties|Parameter value]] will be passed - See the Flowcode example below.
 
 
[[File:Gen_Component_Key_Mappings_01.png]]




'''Key'''
'''Key'''


The key on the number keypad that you wish to map.
The key-combination that you wish to map. This may be any alphabetic or numeric key, optionally combined with Alt, Shift or Control.




'''Component'''
'''Action'''


The attached component that you wish to map the key to.
This can be any calculation line for your flowchart or a user macro call.




'''Element'''
'''Example'''


The individual element (Switch etc.) that you wish to bind the key to.
Here is a simple example showing key mappings in simulation.  


Keyboard keys pressed:


Elements are numbered sequentially in the same order as on the component.
1 = Toggle Switch1


Components with scrollbars use elements 1 and 2 to increase/decrease the scrollbar value.
2 = Toggle Switch2


Using Key mapping with elements that toggle will toggle the element on/off.
3 = Toggle Switch3


Using key mapping with press to make elements will send the element into its high, active, state when the key is pressed.
I = Increment Count variable


Releasing the key will return the element to its low, inactive state.
D = Decrement Count variable


Using key mapping with scrollbars will increase/decrease the scrollbar value.
{{Fcfile|Key_Mapping_Example.fcfx|Key Mapping Example}}

Latest revision as of 10:27, 19 September 2023

Key mappings allow you to use the keyboard keys 0 to 9 or A to Z to control components attached to the microcontroller. For example if you have a bank of 8 push switches connected to the microcontroller, you could map the keys 1 to 8 to mimic the pushing and releasing of these switches when the flowchart is simulated.


To set up or change key mappings, select the Key Mappings option from the Edit menu (Edit > Key Mappings...). For each key you can either enter an expression

Eg. Count = Count + 1

Or enter the name of a user macro and the keyboard key within brackets and the Parameter value will be passed - See the Flowcode example below.



Key

The key-combination that you wish to map. This may be any alphabetic or numeric key, optionally combined with Alt, Shift or Control.


Action

This can be any calculation line for your flowchart or a user macro call.


Example

Here is a simple example showing key mappings in simulation.

Keyboard keys pressed:

1 = Toggle Switch1

2 = Toggle Switch2

3 = Toggle Switch3

I = Increment Count variable

D = Decrement Count variable

Key Mapping Example