2021-01-17 04:47 AM
Hello!
I want to click on the touch screen, get the coordinates, then, without releasing my finger, move my finger and get new coordinates continuously.
Like slider widget)
How do I do this?
This code
void PRINT_PROGRESS_ScreenView::Box3DClickHandler(const BoxWithBorder& b, const ClickEvent& evt)
{
if (&b == &Box3D)
{
//Implement what should happen when 'box' is touched/clicked here.
// if(evt.getType() == ClickEvent::PRESSED)
// {
int x = evt.getX();
int y = evt.getY();
// Do something with x and y, such as...
// presenter->touchRegistered(x, y); // you write this function in the presenter
// }
}
}
gives coordinates only twice time - at pressing and at releasing ....
2021-01-18 01:28 AM
Hi,
I believe the dragEvent could be something to look for in your case, since you continuously get new XY data. It is used as well by the slider widget. Otherwise you could just also use the tickEvent to get the coordinates of the clickEvent every few ticks instead of just at the first touch.
/Romain
2021-01-18 01:36 AM
Hm... I tried to use DragEvent.... But This type of event not appeared. I thought, that drag event is only for dragable widgets. But my widgets is not moveable.
Cab you give me sample of code?
Decision with tickEvent is better for me. Tell me, how can I read current X, Y without detecting event?
2021-01-18 08:23 PM
"se the tickEvent to get the coordinates of the clickEvent every few ticks instead of just at the first touch."
How to?
Give me a sample of code, please...