Move Focus to Type button in new row on Adding a remap (#7586)

This commit is contained in:
Arjun Balgovind
2020-10-29 13:16:52 -07:00
committed by GitHub
parent 6e2191a34e
commit 06cd9409e9
6 changed files with 44 additions and 0 deletions

View File

@@ -13,6 +13,7 @@
#include <keyboardmanager/common/KeyboardManagerState.h>
#include "common/common.h"
#include "LoadingAndSavingRemappingHelper.h"
#include "UIHelpers.h"
extern "C" IMAGE_DOS_HEADER __ImageBase;
using namespace winrt::Windows::Foundation;
@@ -291,8 +292,12 @@ void createEditShortcutsWindow(HINSTANCE hInst, KeyboardManagerState& keyboardMa
addShortcut.Margin({ 10, 0, 0, 25 });
addShortcut.Click([&](winrt::Windows::Foundation::IInspectable const& sender, RoutedEventArgs const&) {
ShortcutControl::AddNewShortcutControlRow(shortcutTable, keyboardRemapControlObjects);
// Whenever a remap is added move to the bottom of the screen
scrollViewer.ChangeView(nullptr, scrollViewer.ScrollableHeight(), nullptr);
// Set focus to the first Type Button in the newly added row
UIHelpers::SetFocusOnTypeButtonInLastRow(shortcutTable, KeyboardManagerConstants::ShortcutTableColCount);
});
// Set accessible name for the add shortcut button