-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add drop down key selection support to Keyboard Manager UI (dev/build-features) #2140
Add drop down key selection support to Keyboard Manager UI (dev/build-features) #2140
Conversation
…arbalgov/editDropDown
…arbalgov/editDropDown
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The dropdowns dont update when the keyboard layout changes. I think this could be solved by updating the dropdowns when they are opened, e.g. by setting a callback to DropDownOpened.
shortcutDropDown.ContextFlyout().SetAttachedFlyout((FrameworkElement)shortcutDropDown, warningFlyout); | ||
|
||
// drop down selection handler | ||
shortcutDropDown.SelectionChanged([&, rowIndex, colIndex, parent, warningMessage](IInspectable const& sender, SelectionChangedEventArgs const&) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should add a Handler to the DropDownOpened
event, where the current Keyboard Layout is checked and the keys shown are updated accordingly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. There was also the case where when you use "Type key" the corresponding drop down has to be set, and if there was a language change while on the type key window it would not be reflected on the drop down since it wasn't opened yet. This was fixed by resetting the drop down item source whenever the user types in a key, that way the latest language is used and it does not happen too often.
…arbalgov/editDropDown
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
} | ||
|
||
// Constructor for shortcut drop down | ||
KeyDropDownControl(size_t rowIndex, size_t colIndex, std::vector<std::vector<Shortcut>>& shortcutRemapBuffer, std::vector<std::unique_ptr<KeyDropDownControl>>& keyDropDownControlObjects, StackPanel parent) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe moving this to a method would be cleaner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved the common part in both the constructors to a separate function. The only thing defined in the two constructors are the selectionchanged handlers.
|
||
ShortcutControl(const int& rowIndex, const int& colIndex) | ||
ShortcutControl(const size_t rowIndex, const size_t colIndex) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why const size_t
here? Seems unnecesary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's size_t
since I'm passing in a vector.size()
as argument while creating the object.
…-features) (#2140) * Added combobox * Formatted and removed unused code * Added drop down support for Edit Keyboard window * Reordered the displayed key list * Add shortcut stack panels and drop downs linked to detect shortcut * Add more selected item logic * Added complete dropdown support for edit shortcuts window * Added Flyout warning for incorrect drop down input * Tweaked warnings * Removed MainWindow code * Changed SelectedValue toSelectedIndex * Removed unnecessary assignments * Added a warning for two dropdowns and the first one is changed to an action key * Added function comments in cpp file * Fixed some comments * Fixed all allocation and out of scope issues * Fix most issues except reloading shortcuts * Fixed issue while reloading shortcuts * Fixed type cast warnings * Changed delete to delete[] * tweaked
Summary of the Pull Request
This PR adds support for the user to select the keys from a drop down for the Edit Keyboard and Edit Shortcuts windows.
PR Checklist
Detailed Description of the Pull Request / Additional comments
/
keys on the keyboard), key selections are made with a second vector which has the corresponding virtual key code for each key name, rather than searching from the keyboard map. This way we ensure a one-to-one mapping since we search index to key code and not key name to key code.Validation Steps Performed
From the landing page try both the redefine a shortcut and remap keyboard options and use drop downs as well as detect UI.