mirror of
https://github.com/airstruck/luigi.git
synced 2026-01-09 15:58:22 +00:00
make sure shortcut was pressed when handling release
This commit is contained in:
@@ -162,9 +162,10 @@ function Input:handlePressStart (layout, button, x, y, widget, shortcut)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function Input:handlePressEnd (layout, button, x, y, widget, shortcut)
|
function Input:handlePressEnd (layout, button, x, y, widget, shortcut)
|
||||||
local hit, widget = checkHit(widget or layout:getWidgetAt(x, y), layout)
|
|
||||||
local originWidget = widget or self.pressedWidgets[button]
|
local originWidget = widget or self.pressedWidgets[button]
|
||||||
if not originWidget then return end
|
if not originWidget then return end
|
||||||
|
local hit, widget = checkHit(widget or layout:getWidgetAt(x, y), layout)
|
||||||
|
local wasPressed = originWidget.pressed[button]
|
||||||
if hit then
|
if hit then
|
||||||
originWidget.pressed[button] = nil
|
originWidget.pressed[button] = nil
|
||||||
end
|
end
|
||||||
@@ -175,7 +176,7 @@ function Input:handlePressEnd (layout, button, x, y, widget, shortcut)
|
|||||||
button = button,
|
button = button,
|
||||||
x = x, y = y
|
x = x, y = y
|
||||||
})
|
})
|
||||||
if (widget == originWidget) then
|
if (widget == originWidget and wasPressed) then
|
||||||
widget:bubbleEvent('Press', {
|
widget:bubbleEvent('Press', {
|
||||||
hit = hit,
|
hit = hit,
|
||||||
button = button,
|
button = button,
|
||||||
|
|||||||
Reference in New Issue
Block a user