Skip to content
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

KeyTipService clashing with Power Toys custom key bindings #1143

Open
dgosbell opened this issue Jun 20, 2023 · 2 comments
Open

KeyTipService clashing with Power Toys custom key bindings #1143

dgosbell opened this issue Jun 20, 2023 · 2 comments

Comments

@dgosbell
Copy link

Do you recall why the decision was made to set the backupFocusedControl to null on the following line instead of calling this.RestoreFocus() ?

https://github.com/fluentribbon/Fluent.Ribbon/blob/10d353ea0250d6f9baac6a06681e9db6c8144f30/Fluent.Ribbon/Services/KeyTipService.cs#LL290C37-L290C37

I have a user who is attempting to remap the Left key to Alt+H using Power Toys (see DaxStudio/DaxStudio#1137) and I think I've been able to track the issue down to the fact that the line above does not restore the focus. I was able to replicate the issue in the showcase app and setting the above line to this.RestoreFocus(); "fixed" the issue, but because I don't understand why the focus was not being restored in the first place I'm not sure what other side effects this change might have.

If this "fix" is overly simplistic I could just go down the route of adding an option to my app to set IsKeyTipHandlingEnabled ="False" - It's a bit of a drastic step, but I don't think it's worth wasting too much time on this issue as I don't see it as an overly common issue.


Environment

  • Fluent.Ribbon v?.?.?
  • Windows 11
  • .NET Framework 4.7.2
@batzen
Copy link
Member

batzen commented Jul 23, 2023

The reason for not restoring focus there is to allow WPF to handle anything related to those keys.

For example if something like "Tab" was pressed this block allows the focus to move, starting at the currently focused control. If we would restore the focus here the navigation would start there and not where we currently are.

Re-Binding left, right, up or down globally sounds like an awful idea as that will interfere with any navigational keyboard navigation in any software.
Re-Binding any "ALT"-key combination globally sounds like an awful idea as that will interfere with access keys and menu navigation in any software.

Will try to see whats's going on there really as your user reports it's working fine in Office.

@dgosbell
Copy link
Author

Re-Binding any "ALT"-key combination globally sounds like an awful idea as that will interfere with access keys and menu navigation in any software.

I think they are trying to do some sort of global VIM like key bindings, but this is the first time this has ever come up.

Will try to see whats's going on there really as your user reports it's working fine in Office.

Yes, it was the fact that it seems to work in office that made me dig a bit further.

If you are happy that RestoreFocus() should not be called in the line I highlighted above I could consider adding an option in my app for this user to disable the keytip navigation entirely. But it is a strange request, so I'm not convinced that adding an option like this is a good idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants