diff --git a/builtin/settingtypes.txt b/builtin/settingtypes.txt index c1a0dd941..b89fe9e83 100644 --- a/builtin/settingtypes.txt +++ b/builtin/settingtypes.txt @@ -152,7 +152,7 @@ enable_hotbar_mouse_wheel (Hotbar: Enable mouse wheel for selection) bool true invert_hotbar_mouse_wheel (Hotbar: Invert mouse wheel direction) bool false # Save key controls as scancodes (position on the keyboard) instead of keycodes (the -# symbol marked on the key). This allows using the same phsysical keys with multiple +# symbol marked on the key). This allows using the same physical keys with multiple # keyboard layouts, but the new scancode-based settings can not be parsed by older clients. # Note that this only affects how keybindings are saved in the settings. In particular, # key controls are always matched based on scancodes regardless of this setting. diff --git a/src/client/keycode.cpp b/src/client/keycode.cpp index 74bdeac6b..bbba34d2e 100644 --- a/src/client/keycode.cpp +++ b/src/client/keycode.cpp @@ -241,7 +241,7 @@ static const table_key &lookup_keychar(wchar_t Char) std::ostringstream os; os << ""; auto newsym = wide_to_utf8(std::wstring_view(&Char, 1)); - table_key new_key = {newsym, irr::KEY_KEY_CODES_COUNT, Char, newsym}; + table_key new_key {newsym, irr::KEY_KEY_CODES_COUNT, Char, newsym}; return table.emplace_back(std::move(new_key)); } diff --git a/src/gui/guiKeyChangeMenu.cpp b/src/gui/guiKeyChangeMenu.cpp index 576fa00d6..f39b5967c 100644 --- a/src/gui/guiKeyChangeMenu.cpp +++ b/src/gui/guiKeyChangeMenu.cpp @@ -238,9 +238,9 @@ bool GUIKeyChangeMenu::acceptInput() g_settings->setBool("autojump", ((gui::IGUICheckBox*)e)->isChecked()); } { - gui::IGUIElement *e = getElementFromId(GUI_ID_SAVE_AS_SCANCODES); + const auto *e = getElementFromId(GUI_ID_SAVE_AS_SCANCODES); if(e && e->getType() == gui::EGUIET_CHECK_BOX) { - save_as_scancodes = ((gui::IGUICheckBox*)e)->isChecked(); + save_as_scancodes = dynamic_cast(e)->isChecked(); g_settings->setBool("save_keys_as_scancodes", save_as_scancodes); } }