-
-
Notifications
You must be signed in to change notification settings - Fork 111
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
fix(windows): add api GetContext and TIPProcessKeyEx with IsTextSelected bool #13023
base: fix/windows/7870/add-is-text-selected-flag-api
Are you sure you want to change the base?
fix(windows): add api GetContext and TIPProcessKeyEx with IsTextSelected bool #13023
Conversation
Add the api calls that include the output bool isSelected, which is true if text is selected.
@@ -208,6 +209,7 @@ typedef struct tagKEYMAN64THREADDATA | |||
|
|||
PKEYMANPROCESSOUTPUTFUNC TIPProcessOutput; | |||
PKEYMANGETCONTEXTFUNC TIPGetContext; | |||
PKEYMANGETCONTEXTISSELECTEDFUNC TIPGetContextEx; |
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.
These names should really match -- should be either:
PKEYMANGETCONTEXTISSELECTEDFUNC TIPGetContextEx; | |
PKEYMANGETCONTEXTISSELECTEDFUNC TIPGetContextIsSelected; |
or
PKEYMANGETCONTEXTISSELECTEDFUNC TIPGetContextEx; | |
PKEYMANGETCONTEXTEXFUNC TIPGetContextEx; |
_hr = E_FAIL; // TODO: use S_FALSE -> this tells _KeymanProcessKeystroke to pass keystroke on | ||
} | ||
|
||
if (!Keyman32Interface::TIPProcessKeyEx(_wParam, _lParam, ExtKeymanProcessOutput, ExtKeymanGetContextIsSelected, _fUpdate, _fPreserved)) { | ||
SendDebugMessage(L"TIPProcessKeyEx did not handle the keystroke"); | ||
_hr = E_FAIL; // TODO: use S_FALSE -> this tells _KeymanProcessKeystroke to pass keystroke on | ||
} |
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.
This code is puzzling to me -- why are you calling both TIPProcessKey and TIPProcessKeyEx? Shouldn't be either one or the other?
Test ResultsI tested this issue with the attached "18.0.177-alpha-test-13023" build(24/01/2025) on Windows 10 OS. Here is my observation.
|
as extension of #12649
This adds
GetContextEx
andTIPProcessKeyEx
API call to handle having a output bool parameter that is Bool is there is text selected.User Testing
TEST_DELETE_SELECTED_TEXT
Install the Keyman for Windows build artifact with this PR.
This test must be done with an application using the Text Services Framework (TSF). You cannot use
the Web version of Word. Use WordPad that comes installed with Windows 10 and Windows 11.
Install a Keyman keyboard like EuroLatin
mySchool
School
and type backspaceExpected result
my
Some regression tests.
TEST_BACKSPACE_NO_SELECTION
Install a Keyman keyboard like euro_latin
mySchool
Expected result
mySchoo
TEST_SELECTION_TYPE_CHAR
mySchool
School
and type tExpected result
myt