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

[WIP] Internal text input rework #2077

Closed
wants to merge 1 commit into from
Closed

[WIP] Internal text input rework #2077

wants to merge 1 commit into from

Conversation

kekekeks
Copy link
Member

@kekekeks kekekeks commented Nov 5, 2018

See #2076

@kekekeks kekekeks requested a review from grokys November 5, 2018 19:04
@@ -308,13 +309,20 @@ protected override void OnLostFocus(RoutedEventArgs e)
_presenter?.HideCaret();
}

protected override void OnTextInput(TextInputEventArgs e)
protected override void OnTextInputHandlerSelection(TextInputHandlerSelectionEventArgs e)
Copy link
Member

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?

Copy link
Member Author

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);
Copy link
Member

@grokys grokys Nov 6, 2018

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 TextInput event by default? Ignore me, I see that's what it's doing.


private static Dictionary<Type, bool> s_compatibleTextInputRegistry = new Dictionary<Type, bool>();
private CompatibleTextInputHandler _compatibleTextInputHandler;
class CompatibleTextInputHandler : ITextInputHandler
Copy link
Member

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.

@danwalmsley
Copy link
Member

closing due to inactivity.

@danwalmsley danwalmsley closed this Jul 5, 2020
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

Successfully merging this pull request may close these issues.

3 participants