How to Simulate the keyevent(Key Press Handler) via Simple Touch handler ?

239 views
asked Nov 10, 2017 in GUI Development by maha

Hello

I have a Keyboard and have implemented all the behaviours using it (my making use of "Key Press Handler"). Now i need to do the same using a Virtual keyboard.

My question is, could I able to simulate the key event via a "Simple Touch Handler"? How can I do that ?

In the end, I wanted to continue my implementation only with keyboard and at the same time it should work also with virtual keyboard with no extra effort.

--

Maha

2 Answers

0 votes
answered Nov 10, 2017 by Manfred Schweyer

Dear Maha,

please have a look to the provided example "Editor" that is installed together with Embedded Wizard Studio.

There you will find the integration of a virtual keyboard (class Editor::VirtualKeyboard). Each time the user is touching/releasing the virtual keyboard a key event is generated and sent to the application.

Is this what you are looking for?

Best regards,

Manfred.

0 votes
answered Nov 10, 2017 by Paul Banach

Hi Maha,

you can feed the application with keyboard events by using the root-object's method DriveKeyboardHitting().  This is exact the same interface, which is used to feed the application with events generated by a real hardware keyboard.

An example demonstrating its usage is implemented in two virtual keyboard component templates:

- Please see the chapter Creating components from templates to understand the concept of component templates.

- Now you can add to your project a new component from the template Alphanumeric Keyboard.

- Open the just added keyboard component, you will see following:

- Open the method activateKey. In the Code Editor you see its implementation including the usage of the above mentioned method DriveKeyboardHitting(). The method activateKey does exactly what you want. It feeds a keyboard event to the application according to the pressed key within the virtual keyboard:

Best regards

Paul Banach

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...