diff --git a/src/Window_NDS.c b/src/Window_NDS.c index 21e47601a..64650dd31 100644 --- a/src/Window_NDS.c +++ b/src/Window_NDS.c @@ -90,23 +90,23 @@ static void HandleButtons(int mods) { static void ProcessTouchInput(int mods) { touchPosition pos; touchRead(&pos); - touchActive = mods & KEY_TOUCH; - if (touchActive) { - Pointer_SetPosition(0, pos.px, pos.py); - } // Set starting position for camera movement - if (mods & KEY_TOUCH) { + if (!touchActive && (mods & KEY_TOUCH)) { touchBegX = pos.px; touchBegY = pos.py; } + + touchActive = mods & KEY_TOUCH; + if (touchActive) { + Pointer_SetPosition(0, pos.px, pos.py); + } } void Window_ProcessEvents(double delta) { scanKeys(); int keys = keysDown() | keysHeld(); - Platform_Log1("KEYS: %h", &keys); HandleButtons(keys); Input_SetNonRepeatable(CCMOUSE_L, keys & KEY_TOUCH); @@ -123,9 +123,6 @@ void Window_UpdateRawMouse(void) { touchPosition touch; touchRead(&touch); - int DX = touch.px - touchBegX; - int DY = touch.py - touchBegY; - Platform_Log2("DELTA: %i, %i", &DX, &DY); Event_RaiseRawMove(&PointerEvents.RawMoved, touch.px - touchBegX, touch.py - touchBegY); touchBegX = touch.px;