2024-05-24 05:51 AM
Hello everyone,
Hello @Martin KJELDSEN ,
I have read all the posts in the community, thats with this topic relevant and tried to do the same thing in this post.
I could reversed the screen with 180 degree, except the buttons they staying on the original position. Even when they are clicked then nothing happens.
The post above is few years ago and i don't know if there is some updates to this subject. Otherwise i muss flipping all the screens in the designer.
Regards,
Mahdi
_____________________________________________________________________________
Before flipping:
After:
but the button is not touchable.
Solved! Go to Solution.
2024-05-24 08:42 AM
Hello
What if you press here (red square) ?
Did you remeber to flip touch panel coordinates in sampleTouch-function like Martin instructed. This function is typically placed STM32TouchController.cpp- file in \TouchGFX\target\- folder.
Br JTP
2024-05-24 08:42 AM
Hello
What if you press here (red square) ?
Did you remeber to flip touch panel coordinates in sampleTouch-function like Martin instructed. This function is typically placed STM32TouchController.cpp- file in \TouchGFX\target\- folder.
Br JTP
2024-05-27 06:50 AM - edited 2024-05-27 08:16 AM
Edit 2: It's worked (i was trying with the simulator thats have no touch panel coordinates!)
Hello @JTP1
When i click on the circle position the button will be clicked and shown on bottom!
That was my question the coordinates of touch even should be also flipped but i don't found where they should?
I will look again..
Edit 1: I found it and edited it like this (due my display's resolution 480x272), but I don't know if I did it right because it still doesn't work!
bool STM32F7TouchController::sampleTouch(int32_t& x, int32_t& y)
{
TS_StateTypeDef state = { 0 };
if (isInitialized) {
EDT_TS_GetState(&state);
if (state.touchDetected)
{
x = 479 - state.touchX[0];
y = 271 - state.touchY[0];
return true;
}
}
return false;
}
Br,
Mahdi
2024-05-27 08:19 AM
Hello
Are you testing it in simulator or target ? For simulator you probably need to modify HALSDL2.cpp file.
bool HALSDL2::doSampleTouch(int32_t& x, int32_t& y) const
{
x = 479-(_x - getCurrentSkinX());
y = 271-(_y - getCurrentSkinY());
if (DISPLAY_ROTATION == rotate90)
{
int32_t tmp = x;
x = y;
y = DISPLAY_WIDTH - tmp;
}
return popTouch();
}
Br JTP
2024-05-27 08:22 AM
You are right i was trying it in simulator and then noticed that finally its worked on the display.
Debug -> x,y reading -> on Display testing and worked!
Thanky you...