cancel
Showing results for 
Search instead for 
Did you mean: 

Software trigger for keypressed handler (keyboard example)

Epamuk
Associate III

Hi, I need keyboard for my project. But I dont have touchscreen. I added touchgfx keyboard sample codes to my code. But It needs keypressedHandler.

Which I want to do is to trigger this keyPressedHandler callback from my code.

For example when I get a keycode from uart I want to trigger this callback (like a touchscreen event ocurred)

Anyone has a solution or example code for this purpose ?

Thanks

Erdem

4 REPLIES 4
Xzhiy.1
Associate II

You can make ClickEvent by yourself, many demo have that example code, for example, almost all TouchGFx demo can do auto demo when there is no user tough on screen for some seconds, this is what you need, this sort of code spread in presenter or view class, for example :

presenter.oneSecond();

view.screenClick(ClickEvent::PRESSED, 650, 220);

study demos, you find more.  following funciton from Game2048.

void Game2048View::screenClick(ClickEvent::ClickEventType type, int x, int y)

{

  ClickEvent temp_evt(type, x, y);

  View::handleClickEvent(temp_evt);

}

I hope this is some hint can help some, I just leaning TouchGfx for one week, not know much.

Epamuk
Associate III

Hi,

I cant find "Game2048View::screenClick" function in code. Which touchgfx version are you using? I use 4.16.1

Epamuk
Associate III

OK, I did it. Thanks

Hello @Epamuk​ ,

You can take a look at the following demonstration provided under our H7 Firmware Package ( Path: Projects\STM32H7B3I-EVAL\Demonstrations\ClockAndWeather)

It might help you.

BeST Regards,

Walid