mirror of https://github.com/encounter/SDL.git
Fixed bug 4747 - [Patch] SDL_ShowMessageBox ignores BUTTON_RETURNKEY_DEFAULT flag
Caleb Cornett SDL_ShowMessageBox on UIKit doesn't do anything special with buttons that are marked with the flag SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT. According to Apple's documentation on UIAlertController, a button can respond to a return key if it's marked as the preferredAction of the controller. SDL doesn't set a preferredAction currently, so I've attached a patch to fix that.
This commit is contained in:
parent
e9ec7d41b3
commit
2a1adf71ab
|
@ -91,6 +91,10 @@ UIKit_ShowMessageBoxAlertController(const SDL_MessageBoxData *messageboxdata, in
|
|||
clickedindex = (int)(sdlButton - messageboxdata->buttons);
|
||||
}];
|
||||
[alert addAction:action];
|
||||
|
||||
if (sdlButton->flags & SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT) {
|
||||
alert.preferredAction = action;
|
||||
}
|
||||
}
|
||||
|
||||
if (messageboxdata->window) {
|
||||
|
|
Loading…
Reference in New Issue