-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
[WIP] Internal text input rework #2077
Conversation
@@ -308,13 +309,20 @@ protected override void OnLostFocus(RoutedEventArgs e) | |||
_presenter?.HideCaret(); | |||
} | |||
|
|||
protected override void OnTextInput(TextInputEventArgs e) | |||
protected override void OnTextInputHandlerSelection(TextInputHandlerSelectionEventArgs e) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What scenario does this cover that simply trying to cast the control to ITextInputHandler
doesn't cover? Is it to allow a user-level override of the text input handler, i.e. someone writing an application could choose another ITextInputHandler
for a TextBox
?
If so, what other handlers do you forsee for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
simply trying to cast the control
What control exactly? We could try to check for the currently focused control, but I'd like to have a way for more complex scenario. E. g. some kind of inline completion list taking focus for handling arrow keys while delegating text input to the parent control
void ITextInputHandler.OnTextEntered (uint timestamp, string text) | ||
{ | ||
if (!RaiseCompatibleTextInput(text)) | ||
HandleTextInput(text); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this handler call the old Ignore me, I see that's what it's doing.TextInput
event by default?
|
||
private static Dictionary<Type, bool> s_compatibleTextInputRegistry = new Dictionary<Type, bool>(); | ||
private CompatibleTextInputHandler _compatibleTextInputHandler; | ||
class CompatibleTextInputHandler : ITextInputHandler |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is any more than WIP code it should be moved to a separate class rather than putting it in a #region
.
closing due to inactivity. |
See #2076