Execute action after pressing Enter in menu text field

This commit is contained in:
aurhat
2017-03-20 22:42:21 +01:00
parent baa44b5eb2
commit 0c75b8ef4b
+7
View File
@@ -529,6 +529,13 @@ struct mitemtextinput : mitemtext
virtual void key(int code, bool isdown, int unicode)
{
if(input.key(code, isdown, unicode)) modified = true;
if(action && code == SDLK_RETURN && modified && parent->items.find(this) != parent->items.length() - 1)
{
modified = false;
push("arg1", input.buf);
execute(action);
pop("arg1");
}
}
virtual void init()