Skip to content

Conversation

@zateutsch
Copy link

@zateutsch zateutsch commented Dec 16, 2025

Validation Steps

Running the Project

Option 1: Test via runner

  1. Check out branch zt/new-kbm-localization
  2. Build PowerToys project
  3. Manually build Modules/KeyboardManagerEditorUI project separately
  4. Run runner project
  5. Ensure experimental features are enabled in general settings (should be on by default)
  6. Launch keyboard manager via settings app

Option 2: Test via installer
Pending installer build is successful on this PR,

  1. Install PowerToys via installer
  2. Launch keyboard manager

Validation

For each page (Text, Remappings, Programs, URLs):

  • Create shortcuts with variable options and ensure they run as expected
  • Delete shortcuts and ensure they no longer execute
  • Try to create invalid shorcuts to check for proper validation
  • Ensure created shortcuts appear in Power Toys Settings Keyboard manager page
  • Any feedback on UI design appreciated as well

haoliuu and others added 30 commits February 27, 2025 15:42
* 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 remapping config and data

* display single key to shortcuts mapping properly

* get remapping with operation type so we can display them in different tabs

* clean up the xaml
* 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


![image](https://github.com/user-attachments/assets/e109d82f-01c5-4da7-9efb-facea4070808)

![image](https://github.com/user-attachments/assets/09cc4462-43eb-4823-9b01-ab630a0bf9ed)

![image](https://github.com/user-attachments/assets/9b85c0f6-cbce-40cc-8e65-b755cb852eae)

![image](https://github.com/user-attachments/assets/ff7945cc-6535-4697-812e-93c2effab14e)

![image](https://github.com/user-attachments/assets/7cf887c8-24f3-45bd-956f-b3d655844974)

![image](https://github.com/user-attachments/assets/d958bb16-66b9-44e0-8918-32ddcc780f02)
@zateutsch zateutsch added the Product-Keyboard Shortcut Manager Issues regarding Keyboard Shortcut Manager label Dec 16, 2025
return ValidationErrorType.NoError;
}

// Temporary program shorctut validation

Check failure

Code scanning / check-spelling

Unrecognized Spelling Error

shorctut is not a recognized word. (unrecognized-spelling)
return KeyboardManagerInterop.AddShortcutRemap(_configHandle, originalKeys, targetKeys, targetApp, (int)operationType);
}

public bool AddShorcutMapping(ShortcutKeyMapping shortcutKeyMapping)

Check failure

Code scanning / check-spelling

Unrecognized Spelling Error

Shorcut is not a recognized word. (unrecognized-spelling)
try
{
_mappingService = new KeyboardMappingService();
LoadProgramShrotcuts();

Check failure

Code scanning / check-spelling

Unrecognized Spelling Error

Shrotcuts is not a recognized word. (unrecognized-spelling)
Dispose();
}

private void LoadProgramShrotcuts()

Check failure

Code scanning / check-spelling

Unrecognized Spelling Error

Shrotcuts is not a recognized word. (unrecognized-spelling)
Elevation = elevationLevel,
};

saved = _mappingService.AddShorcutMapping(shortcutKeyMapping);

Check failure

Code scanning / check-spelling

Unrecognized Spelling Error

Shorcut is not a recognized word. (unrecognized-spelling)
<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

Remmapings is not a recognized word. (unrecognized-spelling)
<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

Remmapings is not a recognized word. (unrecognized-spelling)
<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

Remmapings is not a recognized word. (unrecognized-spelling)
<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

Sevice is not a recognized word. (unrecognized-spelling)
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

WINDOWSAPPRUNTIME is not a recognized word. (unrecognized-spelling)
@github-actions
Copy link

@check-spelling-bot Report

🔴 Please review

See the 📂 files view, the 📜action log, or 📝 job summary for details.

Unrecognized words (6)

Remmapings
Sevice
shorctut
Shorcut
Shrotcuts
WINDOWSAPPRUNTIME

These words are not needed and should be removed CLITo CVS Notavailable toolgood Uninitializes

To 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
on the zt/new-kbm-localization branch (ℹ️ how do I use this?):

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 positives

If items relate to a ...

  • binary file (or some other file you wouldn't want to check at all).

    Please add a file path to the excludes.txt file matching the containing file.

    File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.

    ^ refers to the file's path from the root of the repository, so ^README\.md$ would exclude README.md (on whichever branch you're using).

  • well-formed pattern.

    If you can write a pattern that would match it,
    try adding it to the patterns.txt file.

    Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.

    Note that patterns can't match multiline strings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Product-Keyboard Shortcut Manager Issues regarding Keyboard Shortcut Manager

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants