-
Notifications
You must be signed in to change notification settings - Fork 7.5k
[Keyboard Manager] WinUI 3 Keyboard Manager #44305
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
base: main
Are you sure you want to change the base?
Conversation
* Implement a dev version ui which is copy of current WinUI2 UX * Implement WinUI3 dropdown and P/Invoke the key list from existing C++ Library * Update Dllimport path
* Set up static new UX for Keyboard Manager Editor * Improve the formatting and performance * fix spelling
* load URL remapping * Save Remapping Config and Data * update mock data for testing * fix app mapping * update xaml
* add press button * add right press button * add right press button by original button * change toggle button position * fix type error * merge * add link * brush blue in new keys * remove unuse annotations * remove unuse keyvisual
* Make Disable toggle button functional in Shortcuts page * Clean up main window and aggregate Constants * Update key remapping naming * Fix the key visual stretch out issue when the shortcut contains too many keys * Refactor code structure * fix wrapping in dialog * update naming * Implement Keyboard hook to get the user input of remappings * Implement Reset for InputControl to make sure InputControl can have correct status for various dialog
…oard Hook and Input Validator (#39081) * Add delete remapping function * Fix the problem that Keyboard Hook is not cleaned properly when the toggle button lost focus (user clicked other checkbox or switched to another app) * Make sure original toggle button is checked for InputControl * Disable app setting for single key remapping * Update KBM Editor UI Signing * Ensuring Modifier Keys Don't Repeat * Make sure the shortcut takes at most 4 modifier keys and show notification to the user * Show teaching tip for reserved illegal shortcuts - Win+L and Ctrl+Alt+Delete * Add validation to check if the user is trying to remap a key or shortcut that's already mapped for the same app context * Add validation to make sure key/shortcut cannot be mapped to itself * Add validation to check the original/new keys are not empty. Application name must be entered if the specific app checkbox is checked. * Add validation to check shortcuts must contain at least one action key in addition to modifier keys * Add validation to warn orphaned key to user * Unify and consolidate the validation code * Refactor the validation mechanism * Delete the existing remapping when user modified the content
…e-behind functionalities (#39888) <!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## Summary of the Pull Request > [Target feature branch ``feature/KeyboardManagerWinUI3``] Refactor the New Keyboard Manager code to generalize functions (like Keyboard Hook) for use across pages. Implement Code-behind and the Text Remapping Page. - Implement the Text Remapping page - Restructure the Key Remappings code - Implement unified Keyboard Hook for all Pages - Implement Save and Delete for Text Page - Adjust the Text Page list UI - Create Input Control for Text Page - Validate the user input in Text Page and show teaching tip for the validation error - Move Remapping Saving into Helper - Move Remapping Delete into Helper - Don't check for duplicates if the original keys are the same as the remapping being edited - Use InputMode to indicate the active toggle for Original Keys/Remapped Keys - Add Rectangle for all pages      
This reverts commit 0009bbf.
remove ref to programs and url pages
…t/PowerToys into zt/new-kbm-localization
…xt page resource keys
| return ValidationErrorType.NoError; | ||
| } | ||
|
|
||
| // Temporary program shorctut validation |
Check failure
Code scanning / check-spelling
Unrecognized Spelling Error
| return KeyboardManagerInterop.AddShortcutRemap(_configHandle, originalKeys, targetKeys, targetApp, (int)operationType); | ||
| } | ||
|
|
||
| public bool AddShorcutMapping(ShortcutKeyMapping shortcutKeyMapping) |
Check failure
Code scanning / check-spelling
Unrecognized Spelling Error
| try | ||
| { | ||
| _mappingService = new KeyboardMappingService(); | ||
| LoadProgramShrotcuts(); |
Check failure
Code scanning / check-spelling
Unrecognized Spelling Error
| Dispose(); | ||
| } | ||
|
|
||
| private void LoadProgramShrotcuts() |
Check failure
Code scanning / check-spelling
Unrecognized Spelling Error
| Elevation = elevationLevel, | ||
| }; | ||
|
|
||
| saved = _mappingService.AddShorcutMapping(shortcutKeyMapping); |
Check failure
Code scanning / check-spelling
Unrecognized Spelling Error
| <data name="RemappingsPageOriginalKeysTextBlock.Text" xml:space="preserve"> | ||
| <value>Original key(s)</value> | ||
| </data> | ||
| <data name="RemmapingsPageOrphanedKeysTeachingTip.ActionButtonContent" xml:space="preserve"> |
Check failure
Code scanning / check-spelling
Unrecognized Spelling Error
| <data name="RemmapingsPageOrphanedKeysTeachingTip.ActionButtonContent" xml:space="preserve"> | ||
| <value>Continue anyway</value> | ||
| </data> | ||
| <data name="RemmapingsPageOrphanedKeysTeachingTip.CloseButtonContent" xml:space="preserve"> |
Check failure
Code scanning / check-spelling
Unrecognized Spelling Error
| <data name="RemmapingsPageOrphanedKeysTeachingTip.CloseButtonContent" xml:space="preserve"> | ||
| <value>Cancel</value> | ||
| </data> | ||
| <data name="RemmapingsPageOrphanedKeysTeachingTip.Title" xml:space="preserve"> |
Check failure
Code scanning / check-spelling
Unrecognized Spelling Error
| <data name="TextPageInputControlTextContentTextBox.Header" xml:space="preserve"> | ||
| <value>Text to insert</value> | ||
| </data> | ||
| <data name="TextPageDeleteButton.ToolTipSevice.ToolTip" xml:space="preserve"> |
Check failure
Code scanning / check-spelling
Unrecognized Spelling Error
| ProcessStartInfo startInfo = new ProcessStartInfo(path); | ||
| startInfo.UseShellExecute = true; // LOAD BEARING | ||
| startInfo.Arguments = $"{type.ToString(CultureInfo.InvariantCulture)} {Environment.ProcessId}"; | ||
| System.Environment.SetEnvironmentVariable("MICROSOFT_WINDOWSAPPRUNTIME_BASE_DIRECTORY", null); |
Check failure
Code scanning / check-spelling
Unrecognized Spelling Error
@check-spelling-bot Report🔴 Please reviewSee the 📂 files view, the 📜action log, or 📝 job summary for details.Unrecognized words (6)Remmapings These words are not needed and should be removedCLITo CVS Notavailable toolgood UninitializesTo accept these unrecognized words as correct and remove the previously acknowledged and now absent words, you could run the following commands... in a clone of the [email protected]:microsoft/PowerToys.git repository curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/c635c2f3f714eec2fcf27b643a1919b9a811ef2e/apply.pl' |
perl - 'https://github.com/microsoft/PowerToys/actions/runs/20256621830/attempts/1' &&
git commit -m 'Update check-spelling metadata'If the flagged items are 🤯 false positivesIf items relate to a ...
|
Validation Steps
Running the Project
Option 1: Test via runner
zt/new-kbm-localizationModules/KeyboardManagerEditorUIproject separatelyrunnerprojectOption 2: Test via installer
Pending installer build is successful on this PR,
Validation
For each page (Text, Remappings, Programs, URLs):