Understanding Key Presses

Getting started with Touch Portal

This guide will show you all options in Touch Portal to do key presses in your software.

Virtual key presses (Windows and MacOS)

The option Touch Portal implemented first was the use of virtual key presses. This system work great and sends virtual keys to the OS. Virtual keys are based on the US-International types of keyboards so there are some limitations with using this.

When you add the virtual key as an action to your button it will pop up this window. At (1) the selected keys are listed. When you execute this action these buttons will be pressed in order and then when they are all pressed they will be released in reverse order after the press duration is passed (3). You can either press the key on your keyboard or select the keys from the overview (4) to add them to this action. If you are not happy with the current keys, just hit the clear button (2) and start over.

Virtual keys are the least low level comparison to actual keyboard key presses. Because of this, some software may not accept these. In some cases this means that the keys pressed on your non-US-International keyboards it may not function as expected. In some cases you need to make the press duration shorter or longer to make them work. For windows user we have also implemented Low-level keys to overcome these and more issues.



Low-level key presses (Windows only)

On windows we have added the low-level key presses as they are a big improvement over the virtual keys. These key mimic actual keyboard presses a lot better enabling these to be used in even more games and applications.

The popup window to set up this action is similar to the virtual keys with two distinctions. At (1) you can specify which type of keyboard you want to simulate. For most users the 'International Keyboard keys' will be the layout to use but for some who have a different keyboard layout you may want to change it to be able to use specific keys only found on those keyboards. The other difference is that because we are no longer using the virtual keys we cannot add key by pressing the keyboard. You need to select the keys from the overview section (2).

Where virtual keys are very high level, low-level keys can make a distinction between the left and right keys on your keyboard such as Alt, Control, Shift and others. Also differences between the Enter and the Return key can be used. Just understand that not all applications or games you use these with may know the difference.

Using this same system we have opened up the possibility to use the F25-F32 keys. Only a few applications will recognize these keys and although they are listed in the low-level key presses actions, their nature is more virtual.



Press and Hold key (Windows only)

Although you can press and hold keys in the previous types of actions it is limited to pressing all the keys at once and releasing them. Sometimes you want to keep pressing a key while doing other actions suchs as mouse clicks.

Creating the press and hold action works the same as the low-level key presses and also uses that same system. The great thing with this is that you can add an unlimited amount of actions that will be executed while you press these keys. In our example while pressing the Left Shift



Holding a key (On Hold)

You can also add the low-level key press to the On Hold section of a button. Doing this will press the key down when you press the button on your mobile device. Once you release your finger from the button on your mobile. The key will be released as well.

Although people expect a button to be repeated when you press a button, this is not what happens with this action. This repeating functionality is done by keyboard drivers but it is not default behaviour when pressing a key. What happens is that the press event is send multiple times while the release event of akey press is only send when you release this. At this moment Touch Portal does not mimic this behaviour and only implements a clean press and release strategy. We have it on our backlog to implement at some point though.




Back to Guide Overview