cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to handle physical key pressed and released events separately in the simulator?

ASuom.1
Associate

In our GUI we need to trigger a visible change when a physical button is pressed and another change when it is released. When using real hardware I can supply separate key codes for key pressed and released events from the ButtonController class, but i cannot find any way to do this in the simulator.

1 REPLY 1
ASuom.1
Associate

I figured it out myself. It can be done by modifying the the taskEntry() method and the sampleKey() method in the HALSDL2 class. The event.key.repeat variable must be checked in the SDL_KEYDOWN and SDL_KEYUP events because SDL generates repeated key events.

I ended up creating an own derived HAL class because I did not want to modify the original one.