diff options
author | TomFrost | 2011-09-25 14:13:47 -0400 |
---|---|---|
committer | TomFrost | 2011-09-25 14:13:47 -0400 |
commit | c958701c788217e93534deb6f5059e0a702531e8 (patch) | |
tree | a0e19d218780c870e22ff7e8f034cf1300c056c0 /backends/events/webossdl/webossdl-events.cpp | |
parent | 9467e4d8d4270deaa24e2d040f504fee82fc96ec (diff) | |
download | scummvm-rg350-c958701c788217e93534deb6f5059e0a702531e8.tar.gz scummvm-rg350-c958701c788217e93534deb6f5059e0a702531e8.tar.bz2 scummvm-rg350-c958701c788217e93534deb6f5059e0a702531e8.zip |
WebOS: Make right-clicks last longer.
While the right-click was working in most games, the
weapon-switching in Full Throttle wasn't registering the click.
Holding the button down for 50ms instead of immediately firing
the mouseup fixes the issue.
Diffstat (limited to 'backends/events/webossdl/webossdl-events.cpp')
-rw-r--r-- | backends/events/webossdl/webossdl-events.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/backends/events/webossdl/webossdl-events.cpp b/backends/events/webossdl/webossdl-events.cpp index 778f41dd7e..be96f20e12 100644 --- a/backends/events/webossdl/webossdl-events.cpp +++ b/backends/events/webossdl/webossdl-events.cpp @@ -209,10 +209,11 @@ bool WebOSSdlEventSource::handleMouseButtonUp(SDL_Event &ev, // right mouse click. else if (ev.button.which == 1 && _fingerDown[0] && _fingerDown[1] && !_fingerDown[2]) { - event.type = Common::EVENT_RBUTTONUP; - processMouseEvent(event, _curX, _curY); - g_system->getEventManager()->pushEvent(event); + //event.type = Common::EVENT_RBUTTONUP; + //g_system->getEventManager()->pushEvent(event); event.type = Common::EVENT_RBUTTONDOWN; + processMouseEvent(event, _curX, _curY); + _queuedRUpTime = g_system->getMillis() + QUEUED_RUP_DELAY; } // If two fingers are down and a third taps, it's a middle @@ -372,8 +373,9 @@ bool WebOSSdlEventSource::pollEvent(Common::Event &event) { // Run down the priority list for queued events. The built-in // event queue runs events on the next poll, which causes many - // WebOS devices to ignore certain inputs. Allowing keys to - // stay "down" longer is enough to register the press. + // WebOS devices (and a few game engines) to ignore certain inputs. + // Allowing keys and clicks to stay "down" longer is enough to register + // the press. if (_queuedEscapeUpTime != 0 && curTime >= _queuedEscapeUpTime) { event.type = Common::EVENT_KEYUP; event.kbd.flags = 0; @@ -390,6 +392,12 @@ bool WebOSSdlEventSource::pollEvent(Common::Event &event) { _queuedSpaceUpTime = 0; return true; } + else if (_queuedRUpTime != 0 && curTime >= _queuedRUpTime) { + event.type = Common::EVENT_RBUTTONUP; + processMouseEvent(event, _curX, _curY); + _queuedRUpTime = 0; + return true; + } else if (_queuedDragTime != 0 && curTime >= _queuedDragTime) { event.type = Common::EVENT_LBUTTONDOWN; _dragging = true; |