tiled icon indicating copy to clipboard operation
tiled copied to clipboard

Pan with spacebar blocks main window

Open aporto opened this issue 12 years ago • 4 comments

When the user holds the spacebar to perform a map scrolling/pan, and, if the user move the focus to another program and returns to tiled, the mouse is hijacked by the pan function and user cannot use any other button or menu. The only alternative is to force the process to stop via Task Manager. All work not saved is lost.

To reproduce:

  • Open a map in Tiled
  • Open another program that uses the same key/mouse combination, like Photoshop.
  • It's best to try using 2 video monitores, each aplication on a full screen.
  • Press SPACEBAR to pan and move the map around
  • Quickly change to the other application
  • Release mouse and SPACEBAR. Then press it again to use the same function on the other application. -Return to Tiled. The mouse shall now be hijacked with the pan function

Using Tiled 0.9

aporto avatar Jun 30 '13 12:06 aporto

On which platform is this?

I've tried to reproduce it on Windows 7. When I press space and then switch to another application, release space and then switch back, indeed Tiled still thinks I got space pressed and it seems 'locked' in this mode. I think this should be fixed, however I was still able to 'unlock' Tiled easily by pressing and releasing space.

bjorn avatar Jul 01 '13 19:07 bjorn

I'm using Windows 7, with 2 video monitores: The left one has Tiled full screen. The right has Photoshop full screen.

Whenever I'm staring at Photoshop screen and try to pan, but forgot that the focus was on the Tiled screen, this problem appear, because I move the mouse to Photoshop while panning on Tiled.

In my case, I can't disable the pan function. No key or menu button works. I have to kill the process via Task Manager :(

On Mon, Jul 1, 2013 at 4:37 PM, Thorbjørn Lindeijer < [email protected]> wrote:

On which platform is this?

I've tried to reproduce it on Windows 7. When I press space and then switch to another application, release space and then switch back, indeed Tiled still thinks I got space pressed and it seems 'locked' in this mode. I think this should be fixed, however I was still able to 'unlock' Tiled easily by pressing and releasing space.

— Reply to this email directly or view it on GitHubhttps://github.com/bjorn/tiled/issues/462#issuecomment-20304982 .

aporto avatar Jul 01 '13 23:07 aporto

@aporto The latest Tiled daily builds are based on a much more recent Qt version (5.3). It's possible that this may have resolved this issue. Would you be able to check this?

bjorn avatar May 25 '14 19:05 bjorn

diff --git a/src/tiled/pannableviewhelper.cpp b/src/tiled/pannableviewhelper.cpp
index 82ba50e7..63503512 100644
--- a/src/tiled/pannableviewhelper.cpp
+++ b/src/tiled/pannableviewhelper.cpp
@@ -71,6 +71,12 @@ private:
             }
             break;
         }
+        case QEvent::WindowDeactivate:
+            if (mSpacePressed) {
+                mSpacePressed = false;
+                emit spacePressedChanged(false);
+            }
+            break;
         default:
         break;
         }

cannister-of-sparrows avatar Jul 13 '25 19:07 cannister-of-sparrows