-
-
Notifications
You must be signed in to change notification settings - Fork 521
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
Basic fix for KeyTips not working when focus is inside a WinForms control #254
Conversation
…trol When pressing Alt and then a letter (input focus: WinForms textbox), Alt will make the KeyTips show, but the letter will be typed into the focused WinForms control instead of navigating through the ribbon. As far as I can see, the reason for this is primarily that OnFocusedElementPreviewTextInput can not be attached to the currently focused WinForms control. This behaviour has not been an issue in older versions of Fluent. In order to fix the problem, in OnWindowKeyDown() e.Key will be forwarded to the KeyTip adorners. This fix is incomplete though. Since all keys must be set to "handled" here to avoid typing into the WinForms textbox, this will also swallow the "up/down" navigation in menus. I'm not quite sure what the best approach for fixing this should be. I also modified the showcase app to show the two different textboxes for testing the key tip behaviours in both scenarios.
Will merge this, but please have a look at the AppVeyor build results after you proposed a PR. |
Basic fix for KeyTips not working when focus is inside a WinForms control
And thanks for contributing! This also inspired me to start my refactoring on the keytip adorner, completely getting rid of focus tracking there. ;-) |
That sounds good, but what does it mean exactly? ;) |
I means that i will remove everything related to focus tracking and keyboard input from the adorner class and handle that in the service. Currently keyboard input is handled in both classes, which makes it kind of difficult to follow the code.
Not really rewriting, just consolidating and "moving" code.
I am always interested in suggestions on how to fix issues and this part is, coincidentally, the last remaining one and where i stopped yesterday. ;-) |
OK, I can look into that further...but as far as I can see you didn't check in any changes yet? I assume it would be good to have the current code for working on a solution. |
Will push my changes later. |
When pressing Alt and then a letter (input focus: WinForms textbox), Alt
will make the KeyTips show, but the letter will be typed into the
focused WinForms control instead of navigating through the ribbon. As
far as I can see, the reason for this is primarily that
OnFocusedElementPreviewTextInput can not be attached to the currently
focused WinForms control. This behaviour has not been an issue in older
versions of Fluent.
In order to fix the problem, in OnWindowKeyDown() e.Key will be
forwarded to the KeyTip adorners. This fix is incomplete though. Since
all keys must be set to "handled" here to avoid typing into the WinForms
textbox, this will also swallow the "up/down" navigation in menus. I'm
not quite sure what the best approach for fixing this should be.
I also modified the showcase app to show the two different textboxes for
testing the key tip behaviours in both scenarios.