456 views
in System Integration by
Hello and goodmorning,

I am building a GUI that uses Keyhandlers to navigate and do some other functions. I have implement OnPress, OnHold and OnRelease slot methods and some times the OnHold and OnPress call for diferent slot methods. In the program prototyper everything works grat. My problem begins when i am installing the GUI to the device. for what i am understanding the problem is how to get the buttons singals from the device. Right now the guys that developing the device using this code to send the signal   

"We detect pin state (with debounce) and call the keyboard hitting function as appropriate

    when the input is pressed
    keyEvRet |= CoreRoot__DriveKeyboardHitting(rootObject, key, 0, 1);
    or when the input is released
    keyEvRet |= CoreRoot__DriveKeyboardHitting(rootObject, key, 0, 0);

Afterwards we use the example code as it is, which updated the viewport if needed.
The result we get is that actions are performed on key release and we also don't have any hold functionality."

 

i am getting only OnPress and OnRelease functions working but not OnHold.

 

what i should ask from them so i can get the OnHold function working?

 

Thank you

George

1 Answer

+1 vote
by
 
Best answer

Hello Georg,

I have understood, that your implementation works with press and release events. What is not working are the hold events. The hold event in fact depends on the keyboard sending repetition events. When the user presses and holds a key, your keboard (or keyborad driver) should send periodically the 'PRESS' event. In other words, when the user presses and holds the key, following sequence of CoreRoot__DriveKeyboardHitting() invocations should be performed:

1. The user presses the key (will be interpreted as initial 'press' event):

CoreRoot__DriveKeyboardHitting(rootObject, key, 0, 1);
 

2. The user still holds the key. (will be interpreted as repetition or 'hold' event):

CoreRoot__DriveKeyboardHitting(rootObject, key, 0, 1);
CoreRoot__DriveKeyboardHitting(rootObject, key, 0, 1);

[...]
CoreRoot__DriveKeyboardHitting(rootObject, key, 0, 1);

 

3. The user releases the key. (will be interpreted as 'release' event):

CoreRoot__DriveKeyboardHitting(rootObject, key, 0, 0);

If in your device the keyboard or (hardware buttons) do not send the repetition events, my suggestion would be to simulate it with your own timer. 

Does it help you?

Best regards

Paul Banach

by
Dear Paul,

That was very helpfull and looks like we fixed the problem

Thank you :)

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

...