mirror of
https://github.com/glfw/glfw.git
synced 2025-06-14 19:52:14 +00:00
macOS: Enable to clear preedit after commit input.
This commit is contained in:
parent
c2923ac577
commit
86b2c3b579
@ -751,6 +751,9 @@ static const NSRange kEmptyRange = { NSNotFound, 0 };
|
|||||||
- (void)unmarkText
|
- (void)unmarkText
|
||||||
{
|
{
|
||||||
[[markedText mutableString] setString:@""];
|
[[markedText mutableString] setString:@""];
|
||||||
|
window->nblocks = 0;
|
||||||
|
window->ntext = 0;
|
||||||
|
_glfwInputPreedit(window, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSArray*)validAttributesForMarkedText
|
- (NSArray*)validAttributesForMarkedText
|
||||||
@ -816,6 +819,8 @@ static const NSRange kEmptyRange = { NSNotFound, 0 };
|
|||||||
_glfwInputChar(window, codepoint, mods, plain);
|
_glfwInputChar(window, codepoint, mods, plain);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[self unmarkText];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)doCommandBySelector:(SEL)selector
|
- (void)doCommandBySelector:(SEL)selector
|
||||||
@ -2008,7 +2013,7 @@ VkResult _glfwCreateWindowSurfaceCocoa(VkInstance instance,
|
|||||||
|
|
||||||
void _glfwPlatformResetPreeditText(_GLFWwindow* window)
|
void _glfwPlatformResetPreeditText(_GLFWwindow* window)
|
||||||
{
|
{
|
||||||
NSTextInputContext *context = [NSTextInputContext currentInputContext];
|
NSTextInputContext* context = [NSTextInputContext currentInputContext];
|
||||||
[context discardMarkedText];
|
[context discardMarkedText];
|
||||||
[window->ns.view unmarkText];
|
[window->ns.view unmarkText];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user