diff --git a/src/app/commands/cmd_cel_properties.cpp b/src/app/commands/cmd_cel_properties.cpp index 86d895120..00e7fb13a 100644 --- a/src/app/commands/cmd_cel_properties.cpp +++ b/src/app/commands/cmd_cel_properties.cpp @@ -117,6 +117,16 @@ private: bool onProcessMessage(ui::Message* msg) override { switch (msg->type()) { + case kKeyDownMessage: + if (opacity()->hasFocus()) { + if (static_cast(msg)->scancode() == kKeyEnter) { + onCommitChange(); + closeWindow(this); + return true; + } + } + break; + case kCloseMessage: // Save changes before we close the window setCel(nullptr, nullptr); diff --git a/src/app/commands/cmd_layer_properties.cpp b/src/app/commands/cmd_layer_properties.cpp index 4f0890f97..919bf79f2 100644 --- a/src/app/commands/cmd_layer_properties.cpp +++ b/src/app/commands/cmd_layer_properties.cpp @@ -132,6 +132,18 @@ private: bool onProcessMessage(ui::Message* msg) override { switch (msg->type()) { + case kKeyDownMessage: + if (name()->hasFocus() || + opacity()->hasFocus() || + mode()->hasFocus()) { + if (static_cast(msg)->scancode() == kKeyEnter) { + onCommitChange(); + closeWindow(this); + return true; + } + } + break; + case kCloseMessage: // Save changes before we close the window setLayer(nullptr);