summaryrefslogtreecommitdiff
path: root/src/ui/touch.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-09-13 19:52:21 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-09-13 19:52:21 +0300
commit4cf52f29b926a924d838a3158d5c78b3337ee0ee (patch)
treedf72c72e3edccb9ce88136c7caa6d3644b1c8349 /src/ui/touch.c
parentaeb65e88297725634a4e55663e2ecc83805d9073 (diff)
Mobile: New selection logic for InputWidget
Touch-based interaction requires a different kind of selection and copy/paste behavior. This isn't done yet; especially multi-line text still needs work.
Diffstat (limited to 'src/ui/touch.c')
-rw-r--r--src/ui/touch.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/ui/touch.c b/src/ui/touch.c
index 5fc8f245..61882739 100644
--- a/src/ui/touch.c
+++ b/src/ui/touch.c
@@ -293,6 +293,7 @@ static void update_TouchState_(void *ptr) {
293 } 293 }
294 if (elapsed > 50 && !touch->isTapBegun) { 294 if (elapsed > 50 && !touch->isTapBegun) {
295 /* Looks like a possible tap. */ 295 /* Looks like a possible tap. */
296 touchState_()->currentTouchPos = initF3_I2(touch->pos[0]);
296 dispatchNotification_Touch_(touch, widgetTapBegins_UserEventCode); 297 dispatchNotification_Touch_(touch, widgetTapBegins_UserEventCode);
297 dispatchMotion_Touch_(touch->pos[0], 0); 298 dispatchMotion_Touch_(touch->pos[0], 0);
298 refresh_Widget(touch->affinity); 299 refresh_Widget(touch->affinity);
@@ -471,13 +472,13 @@ iBool processEvent_Touch(const SDL_Event *ev) {
471 } 472 }
472 iTouchState *d = touchState_(); 473 iTouchState *d = touchState_();
473 iWindow *window = get_Window(); 474 iWindow *window = get_Window();
474 if (!isFinished_Anim(&window->rootOffset)) { 475// if (!isFinished_Anim(&window->rootOffset)) {
475 return iFalse; 476// return iFalse;
476 } 477// }
477 const iInt2 rootSize = size_Window(window); 478 const iInt2 rootSize = size_Window(window);
478 const SDL_TouchFingerEvent *fing = &ev->tfinger; 479 const SDL_TouchFingerEvent *fing = &ev->tfinger;
479 const iFloat3 pos = add_F3(init_F3(fing->x * rootSize.x, fing->y * rootSize.y, 0), /* pixels */ 480 const iFloat3 pos = add_F3(init_F3(fing->x * rootSize.x, fing->y * rootSize.y, 0), /* pixels */
480 init_F3(0, -value_Anim(&window->rootOffset), 0)); 481 init_F3(0, 0 /*-value_Anim(&window->rootOffset)*/, 0));
481 const uint32_t nowTime = SDL_GetTicks(); 482 const uint32_t nowTime = SDL_GetTicks();
482 if (ev->type == SDL_FINGERDOWN) { 483 if (ev->type == SDL_FINGERDOWN) {
483 /* Register the new touch. */ 484 /* Register the new touch. */