From 5d9a430466dc851a796becd4fdc438a2e79cb2c2 Mon Sep 17 00:00:00 2001 From: bethune-bryant Date: Wed, 2 Nov 2016 18:00:12 -0500 Subject: [PATCH] Handle more key presses in message dialog, similar to default menu behavior. --- src/MessageBox/MessageBox.as | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/MessageBox/MessageBox.as b/src/MessageBox/MessageBox.as index 367608ae..a7b30d3c 100644 --- a/src/MessageBox/MessageBox.as +++ b/src/MessageBox/MessageBox.as @@ -169,11 +169,13 @@ class MessageBox extends MovieClip private function onKeyDown(): Void { - if (Key.getCode() == 89 && _buttons[0].ButtonText.text == "Yes") { + //Select yes on the key press of 'Y' or 'E' or space key. + if (_buttons[0].ButtonText.text == "Yes" && (Key.getCode() == 89 || Key.getCode() == 69 || Key.getCode() == Key.SPACE)) { GameDelegate.call("buttonPress", [0]); return; } - if (Key.getCode() == 78 && _buttons[1].ButtonText.text == "No") { + //Select no on the key press of 'N' or escape or tab key. + if (_buttons[1].ButtonText.text == "No" && (Key.getCode() == 78 || Key.getCode() == Key.ESCAPE || Key.getCode() == Key.TAB)) { GameDelegate.call("buttonPress", [1]); return; }