Using full Key Support

This forum contains common answers to questions and tutorials produced for the community.
mwalker

Using full Key Support

Post by mwalker » Wed Sep 01, 2010 10:53 am

I selected the 'Key Hold' and 'Key Up' tabs and expected to be able to switch views and fire events from these key actions. Nothing happened. Only 'Key Press' seems to work. Do I need to do further configuration to make this happen?
jpurdum
Enovation Controls Development
Enovation Controls Development
Posts: 153
Joined: Mon Jun 21, 2010 11:19 am

Re: Using full Key Support

Post by jpurdum » Thu Sep 02, 2010 7:04 am

Yes, you can do this, but you must first enable the Key Up and Key Hold via an action to the Key app. I will ask one of our developers to reply with additional information - hopefully with a demo config.
dbuchanan

Re: Using full Key Support

Post by dbuchanan » Thu Sep 02, 2010 10:13 am

'Key Up' and 'Key Hold' must be enabled before they will work.

Enabling 'Key Up' and 'Key Hold'

You will need to create a 'State Machine' in the 'Programming' tab in the Configuration Tool so you can enable the desired feature with either:

Code: Select all

Keys->Enable Key Up((Empty))
or
Keys->Enable Key Hold((Empty))
A simple way to demonstrate this is to create a new one state State Machine in the Programming tab. Name it something like 'SM_Enable_Key_Up'.

Add a single State to the State Machine. Name it something like 'ST_Enable_Key_Up'.

In the 'On exiting state execute these actions' section click on the '+' key. In the dialog that pops up, click on the 'Keys' application, then click on the desired Action - either 'Enable Key Up' or 'Enable Key Hold'. Then click the 'OK' button to finish adding the exit action. If you want to enable both features at the same time, go ahead and add a second exit action to do this.

Then add a single 'State Transition' to the State you just created. Click on 'State Transition', then click and hold on the State you just created. Drag the mouse pointer around outside the State box then back into the State box and release the mouse button. You should now have a 'loop around' transition named something like: 'ST_Enable_Key_Up to ST_Enable_Key_Up'. Leave the 'Generate Event for this transition' box checked.

The attached image file shows a picture of what this would look like:
KeyUpExample.jpg
Picture of State Machine.
KeyUpExample.jpg (45.7 KiB) Viewed 137 times
Now to enable the feature, you need to 'trigger' the event that you just created:
'ST_Enable_Key_Up to ST_Enable_Key_Up'

A simple way to demonstrate that is to go back to the 'Page Designer' screen and assign one of the 'Key Press' selections to fire the event you just created. (Note: 'Key Press' unlike 'Key Hold' and 'Key Up' is always enabled.) As an example, if you click on the upper left key and select 'Fire an Event', you will find the event you created in the list. Select it and click on 'OK'. Now all you have to do to active the desired feature is press that button.

Using 'Key Up' and 'Key Hold' on the Page Designer screen

On the 'Page Designer' screen in the lower left there is a 'Key ...' icon. When you click on it it cycles between 'Key Press', 'Key Hold', and 'Key Up'. By clicking and cycling through these selections you can assign any or all of these events to any given key.

'Key Up' events will fire as soon as you release a key.

For a 'Key Hold' event to fire, you must press and hold the key for at least 5 seconds, then the event will fire when you release the key.

The attached demonstration configuration file demonstrates this.
Regression_Test_7_3_2_Key_Repeat_Hold_Up.7z
Sample configuration that demonstrates 'Key Up' and 'Key Hold'.
(2 MiB) Downloaded 24 times