App Developper: switch on keyboard

Post here to discuss any new features, components, chips, etc, that you would like to see in Flowcode.
Post Reply
stefan.erni
Valued Contributor
Posts: 758
http://meble-kuchenne.info.pl
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 149 times
Been thanked: 171 times

Flowcode v10 App Developper: switch on keyboard

Post 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
Snag_897748.png (39.86 KiB) Viewed 745 times

mnfisher
Valued Contributor
Posts: 953
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 104 times
Been thanked: 507 times

Re: App Developper: switch on keyboard

Post 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

Steve-Matrix
Matrix Staff
Posts: 1252
Joined: Sat Dec 05, 2020 10:32 am
Has thanked: 167 times
Been thanked: 277 times

Re: App Developper: switch on keyboard

Post 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.
Attachments
button press app.mscada
(4.32 KiB) Downloaded 38 times
button press app.fcsx
(15.05 KiB) Downloaded 39 times

stefan.erni
Valued Contributor
Posts: 758
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 149 times
Been thanked: 171 times

Re: App Developper: switch on keyboard

Post 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
button press app_v2.fcsx
(13.03 KiB) Downloaded 38 times
Snag_715c8.png
Snag_715c8.png (109.48 KiB) Viewed 734 times

Post Reply