mirror of
https://github.com/keymanapp/keyman.git
synced 2026-10-13 17:37:31 +00:00
fix(windows): TSF apps delete all of smp
When the windows platform recieves the action for a backspace it will check to see if the character being delete is a surrogate pair. If it is and the app is TSF aware app it will need to backspace twice to remove both parts of the surrogate pair. For legacy apps this is not required.
This commit is contained in:
parent
066061f896
commit
0ed826a14f
1 changed files with 11 additions and 2 deletions
|
|
@ -30,8 +30,17 @@ static BOOL processAlert(AITIP* app) {
|
|||
static BOOL processBack(AITIP* app, const km_kbp_action_item* actionItem) {
|
||||
if (actionItem->backspace.expected_type == KM_KBP_BT_MARKER) {
|
||||
app->QueueAction(QIT_BACK, BK_DEADKEY);
|
||||
} else /* actionItem->backspace.expected_type == KM_KBP_BT_CHAR, KM_KBP_BT_UNKNOWN */ {
|
||||
app->QueueAction(QIT_BACK, 0);
|
||||
} else if(actionItem->backspace.expected_type == KM_KBP_BT_CHAR) {
|
||||
// If this is a TSF-aware app we need to set the BK_SURROGATE flag to delete
|
||||
// both parts of the surrogate pair. Legacy apps receive a BKSP WM_KEYDOWN event
|
||||
// which results in deleting both parts in one action.
|
||||
if (!app->IsLegacy() && Uni_IsSMP(actionItem->backspace.expected_value)) {
|
||||
app->QueueAction(QIT_BACK, BK_DEFAULT | BK_SURROGATE);
|
||||
} else {
|
||||
app->QueueAction(QIT_BACK, BK_DEFAULT);
|
||||
}
|
||||
} else { // KM_KBP_BT_UNKNOWN
|
||||
app->QueueAction(QIT_BACK, BK_DEFAULT);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue