Software trigger for keypressed handler (keyboard example)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-08-23 12:54 AM
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
- Labels:
-
TouchGFX
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-08-23 6:27 AM
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.
​
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-08-23 7:49 AM
Hi,
I cant find "Game2048View::screenClick" function in code. Which touchgfx version are you using? I use 4.16.1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-08-24 1:03 AM
OK, I did it. Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-08-24 1:15 AM
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
