Skip to content

Commit

Permalink
Disable GUI enter key default events
Browse files Browse the repository at this point in the history
In order to avoid confusion.
To be enabled again once proper keyboard event handling will be
implemented for GUI dialogs.
  • Loading branch information
barotto committed Dec 22, 2021
1 parent 4c8f724 commit c71f29a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/gui/windows/fileselect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -782,6 +782,11 @@ void FileSelect::on_keydown(Rml::Event &_ev)
case Rml::Input::KeyIdentifier::KI_ADD:
set_zoom(1);
break;
case Rml::Input::KeyIdentifier::KI_RETURN:
case Rml::Input::KeyIdentifier::KI_NUMPADENTER:
// TODO remove when proper keyboard input is implemented
_ev.StopImmediatePropagation();
break;
default:
Window::on_keydown(_ev);
break;
Expand Down
4 changes: 4 additions & 0 deletions src/gui/windows/new_floppy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,12 @@ void NewFloppy::on_keydown(Rml::Event &_ev)
{
switch(get_key_identifier(_ev)) {
case Rml::Input::KeyIdentifier::KI_RETURN:
case Rml::Input::KeyIdentifier::KI_NUMPADENTER:
if(_ev.GetTargetElement() == m_filename_el) {
on_create_file(_ev);
} else {
// TODO remove when proper keyboard input is implemented
_ev.StopImmediatePropagation();
}
break;
default:
Expand Down
5 changes: 5 additions & 0 deletions src/gui/windows/state_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,11 @@ void StateDialog::on_keydown(Rml::Event &_ev)
case Rml::Input::KeyIdentifier::KI_ADD:
set_zoom(1);
break;
case Rml::Input::KeyIdentifier::KI_RETURN:
case Rml::Input::KeyIdentifier::KI_NUMPADENTER:
// TODO remove when proper keyboard input is implemented
_ev.StopImmediatePropagation();
break;
default:
Window::on_keydown(_ev);
break;
Expand Down
4 changes: 4 additions & 0 deletions src/gui/windows/state_save_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,12 @@ void StateSaveInfo::on_keydown(Rml::Event &_ev)
{
switch(get_key_identifier(_ev)) {
case Rml::Input::KeyIdentifier::KI_RETURN:
case Rml::Input::KeyIdentifier::KI_NUMPADENTER:
if(_ev.GetTargetElement() == m_desc_el) {
on_save(_ev);
} else {
// TODO remove when proper keyboard input is implemented
_ev.StopImmediatePropagation();
}
break;
default:
Expand Down

0 comments on commit c71f29a

Please sign in to comment.