diff --git a/src/xenia/app/profile_dialogs.cc b/src/xenia/app/profile_dialogs.cc index 206e8e454..54b166d85 100644 --- a/src/xenia/app/profile_dialogs.cc +++ b/src/xenia/app/profile_dialogs.cc @@ -61,6 +61,9 @@ void NoProfileDialog::OnDraw(ImGuiIO& io) { const auto content_files = xe::filesystem::ListDirectories( emulator_window_->emulator()->content_root()); + if (ImGui::IsWindowAppearing()) { + ImGui::SetKeyboardFocusHere(); + } if (content_files.empty()) { if (ImGui::Button("Create Profile")) { new kernel::xam::ui::CreateProfileUI(emulator_window_->imgui_drawer(), diff --git a/src/xenia/kernel/xam/ui/create_profile_ui.cc b/src/xenia/kernel/xam/ui/create_profile_ui.cc index 0429748da..12394c339 100644 --- a/src/xenia/kernel/xam/ui/create_profile_ui.cc +++ b/src/xenia/kernel/xam/ui/create_profile_ui.cc @@ -38,12 +38,13 @@ void CreateProfileUI::OnDraw(ImGuiIO& io) { } ImGui::TextUnformatted("Gamertag:"); - if (ImGui::InputText("##Gamertag", gamertag_, sizeof(gamertag_))) { - valid_gamertag_ = profile_manager->IsGamertagValid(std::string(gamertag_)); - } + const bool enter_pressed = + ImGui::InputText("##Gamertag", gamertag_, sizeof(gamertag_), + ImGuiInputTextFlags_EnterReturnsTrue); + valid_gamertag_ = profile_manager->IsGamertagValid(std::string(gamertag_)); ImGui::BeginDisabled(!valid_gamertag_); - if (ImGui::Button("Create")) { + if (ImGui::Button("Create") || (enter_pressed && valid_gamertag_)) { bool autologin = (profile_manager->GetAccountCount() == 0); if (profile_manager->CreateProfile(std::string(gamertag_), autologin, migration_) && diff --git a/src/xenia/ui/imgui_drawer.cc b/src/xenia/ui/imgui_drawer.cc index 5ed5644ab..6aa3e1326 100644 --- a/src/xenia/ui/imgui_drawer.cc +++ b/src/xenia/ui/imgui_drawer.cc @@ -162,6 +162,7 @@ void ImGuiDrawer::Initialize() { auto& io = ImGui::GetIO(); io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; + io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; const float font_size = std::max((float)cvars::font_size, 8.f); const float title_font_size = font_size + 6.f;