Allow dialogs to close on r-click

develop
Myk Taylor 2023-01-06 10:35:22 -08:00
parent 96f19621c9
commit f43358002d
No known key found for this signature in database
GPG Key ID: 8A39CA0FA0C16E78
1 changed files with 4 additions and 4 deletions

@ -59,11 +59,11 @@ function MessageBox:onDestroy()
end end
function MessageBox:onInput(keys) function MessageBox:onInput(keys)
if keys.SELECT or keys.LEAVESCREEN then if keys.SELECT or keys.LEAVESCREEN or keys._MOUSE_R_DOWN then
self:dismiss() self:dismiss()
if keys.SELECT and self.on_accept then if keys.SELECT and self.on_accept then
self.on_accept() self.on_accept()
elseif keys.LEAVESCREEN and self.on_cancel then elseif (keys.LEAVESCREEN or keys._MOUSE_R_DOWN) and self.on_cancel then
self.on_cancel() self.on_cancel()
end end
return true return true
@ -130,7 +130,7 @@ function InputBox:onInput(keys)
self.on_input(self.subviews.edit.text) self.on_input(self.subviews.edit.text)
end end
return true return true
elseif keys.LEAVESCREEN then elseif keys.LEAVESCREEN or keys._MOUSE_R_DOWN then
self:dismiss() self:dismiss()
if self.on_cancel then if self.on_cancel then
self.on_cancel() self.on_cancel()
@ -231,7 +231,7 @@ function ListBox:getWantedFrameSize()
end end
function ListBox:onInput(keys) function ListBox:onInput(keys)
if keys.LEAVESCREEN then if keys.LEAVESCREEN or keys._MOUSE_R_DOWN then
self:dismiss() self:dismiss()
if self.on_cancel then if self.on_cancel then
self.on_cancel() self.on_cancel()