Code: Select all
local title = "Save the current game?"
local buttons = {"Save", "Cancel", "Don't Save", enterbutton = 1, escapebutton = 2}
local b = love.window.showMessageBox(title, "", buttons, "info", true)
1. This bug seems to be Mac-specific (tested on Mac OS 10.12.3). If the user hits the return or escape key to close the dialog then that key event is seen by my love.keypressed callback. Fortunately this bug is easy to avoid by calling love.event.clear() immediately after the showMessageBox call.
2. This bug seems to be Windows-specific (tested on Windows 7, 64-bit). If the user hits the escape key then the button value returned is 3 (should be 2). If they hit the enter key then the button value returned is 2 (should be 1). This is a much more serious bug because I don't see any way to work around it (other than avoid a 3-button dialog).