Files
Files copied to clipboard
Fix: Fixed an issue where it didn't work to map certain keys to Actions
Resolved / Related Issues
To prevent extra work, all changes to the Files codebase must link to an approved issue marked as Ready to build. Please insert the issue number following the hashtag with the issue number that this Pull Request resolves.
- #15403
Steps used to test these changes
Stability is a top priority for Files and all changes are required to go through testing before being merged into the repo. Please include a list of steps that you used to test this PR.
- Testing the correct mapping of all problem keys
@yaira2 I found the cause of the NumKeys mapping not working, Not localized Pad0-9
Now it's worked
https://github.com/files-community/Files/assets/84145589/1b778795-94d9-4360-8291-2bc7a66856b2
Oh, Decimal (NumPad) key not defined too
Feature
As I follow the definition of the Numpad keys at PowerToys is not bad as they define instead of "Decimal" --> ". (NumPad)"
Experimental Test
But I thought it would be enough to just localize the name 'NumPad' and the rest is default for all standards, at the same time it would be easier to know that the key is from 'NumPad'
https://github.com/files-community/Files/assets/84145589/71e3edab-8fe3-450d-af73-48a22030b198
What do you think about that?
Test own layout (cs-CZ_QWERTZ)
- All Green lines are correct
- Orange lines unused
- Red Box (Caps Lock / Scroll Lock / Num Lock) would be good to disable in the selection, because they are not possible, but they are marked as Empty string and so can be overlooked. After saving the application fails.
Red Box (Caps Lock / Scroll Lock / Num Lock) would be good to disable in the selection, because they are not possible, but they are marked as Empty string and so can be overlooked. After saving the application fails.
Now ignored non-valid keys aka Red Box and more optimalization for speed
-
I added information about invalid key binding to give the user the option to use a different key binding.
-
Works also for already defined key bindings
-
I reworked the logic when the
SaveButtonandAddButtonbuttons are active
Let's get to testing
- Testing functionality across different locations
- [x]
cs-CZ - [x]
sk-SK - [x]
en-US - [x]
ru-RU - [x]
uk-UA - [ ] ... more
- [x]
- [x] Verification and search for possible bugs
- [x] Finalization
Code Quality is over A+. Looks great to me.
Thank you, I'm glad I'm not a useless liability here even though I've only been in this community for a short time. I'll definitely keep trying to improve the quality of the code.
I just have an idea for the future, it would be good to merge all the work with "Key binding" into one class and split it into functions, at least now it's too much for one method https://github.com/files-community/Files/blob/d015e048c50baf19fa95f537aa3913c49bc4beee/src/Files.App/Views/Settings/ActionsPage.xaml.cs#L54-L143
Definitely. We might want to use MS.Windows.Interactivity, MS.Window.Interaction.Core and ViewModel.HandleEditorInputCommand or just call ViewModel.HandleEditorInput();
Sounds good.
Will this have any effect on existing users?
Will this have any effect on existing users?
It won't be, I just fixed the correct display of mapped keys and added an informative teaching tip about invalid key binding