diff --git a/backends/events/webossdl/webossdl-events.cpp b/backends/events/webossdl/webossdl-events.cpp index 778f41dd7e5..be96f20e12d 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; diff --git a/backends/events/webossdl/webossdl-events.h b/backends/events/webossdl/webossdl-events.h index a623a133b8d..3c2679c4a1c 100644 --- a/backends/events/webossdl/webossdl-events.h +++ b/backends/events/webossdl/webossdl-events.h @@ -35,15 +35,15 @@ public: }; WebOSSdlEventSource() : _gestureDown(false), - _dragStartTime(0), - _dragging(false), + _dragStartTime(0), _dragging(false), _curX(0), _curY(0), - _touchpadMode(false), - _autoDragMode(true), + _touchpadMode(false), _autoDragMode(true), _doClick(true), _queuedDragTime(0), _queuedEscapeUpTime(0), _queuedSpaceUpTime(0), + _queuedRUpTime(0), _firstPoll(true), - QUEUED_KEY_DELAY(250), QUEUED_DRAG_DELAY(500) { + QUEUED_KEY_DELAY(250), QUEUED_DRAG_DELAY(500), + QUEUED_RUP_DELAY(50) { for (int i = 0; i < MAX_FINGERS; i++) { _fingerDown[i] = false; _screenDownTime[i] = _dragDiffX[i] = _dragDiffY[i] = 0; @@ -84,11 +84,13 @@ protected: bool _firstPoll; // Event queues - uint32 _queuedDragTime, _queuedEscapeUpTime, _queuedSpaceUpTime; + uint32 _queuedDragTime, _queuedEscapeUpTime, _queuedSpaceUpTime, + _queuedRUpTime; // Standard event queue delays in milliseconds const int QUEUED_KEY_DELAY; const int QUEUED_DRAG_DELAY; + const int QUEUED_RUP_DELAY; virtual void SDLModToOSystemKeyFlags(SDLMod mod, Common::Event &event); virtual bool handleKeyDown(SDL_Event &ev, Common::Event &event);