Page 1 of 1
App Developper: switch on keyboard
Posted: Wed Mar 22, 2023 8:58 am
by stefan.erni
Hi Ben
On my program I have 2 switch.
To press this switch with the mouse or mousepad is working nice.
is there a way to control this switch with the computer keyboard?
As a sample: if i press the key R or F11 it will record and if I press the key s or F12 it will stop the recording
regards
Stefan

- Snag_897748.png (39.86 KiB) Viewed 2210 times
Re: App Developper: switch on keyboard
Posted: Wed Mar 22, 2023 9:22 am
by mnfisher
It's easy to do using the keyboard monitor component.
There is a simple example in the wiki at
https://www.flowcode.co.uk/wiki/index.p ... _Control_)
Martin
Re: App Developper: switch on keyboard
Posted: Wed Mar 22, 2023 9:26 am
by Steve-Matrix
I have another solution that does not need an additional component or code. Use "Key mapping" which is available in the "Edit" menu. Attached is an example, which also uses the new "Macro called" feature of switches.
Re: App Developper: switch on keyboard
Posted: Wed Mar 22, 2023 1:50 pm
by stefan.erni
Hi Martin, Hi Steve
I have tried the example from the wiki but it does not work properly.
up/dwn moves the position of the button. I did not manage to correct this, but then FC10 froze.
I have understood and modified Steve's example and it works fine.
Thanks to both
regards
Stefan

- Snag_715c8.png (109.48 KiB) Viewed 2199 times