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: 1300
http://meble-kuchenne.info.pl
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 246 times
Been thanked: 258 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 3057 times

mnfisher
Valued Contributor
Posts: 2185
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 177 times
Been thanked: 1026 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: 2061
Joined: Sat Dec 05, 2020 10:32 am
Has thanked: 311 times
Been thanked: 479 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 435 times
button press app.fcsx
(15.05 KiB) Downloaded 454 times
(view online)

stefan.erni
Valued Contributor
Posts: 1300
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 246 times
Been thanked: 258 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 472 times
(view online)
Snag_715c8.png
Snag_715c8.png (109.48 KiB) Viewed 3046 times

Post Reply