fixed OK key not sending the correct key event when the connected app passes a standard IME_ACTION through the custom actionId property (#309)
Co-authored-by: Alex Knop <alexknoptech@protonmail.com>
This commit is contained in:
parent
b985eb1849
commit
8ce404d2b6
1 changed files with 9 additions and 11 deletions
|
|
@ -326,20 +326,18 @@ public class TextField {
|
|||
return EditorInfo.IME_ACTION_NONE;
|
||||
}
|
||||
|
||||
int action;
|
||||
if (field.actionId > 0) {
|
||||
return field.actionId; // custom action, defined by the connected app
|
||||
action = field.actionId; // custom action, defined by the connected app
|
||||
} else {
|
||||
action = field.imeOptions & (EditorInfo.IME_MASK_ACTION | EditorInfo.IME_FLAG_NO_ENTER_ACTION);
|
||||
}
|
||||
|
||||
int standardAction = field.imeOptions & (EditorInfo.IME_MASK_ACTION | EditorInfo.IME_FLAG_NO_ENTER_ACTION);
|
||||
switch (standardAction) {
|
||||
case EditorInfo.IME_ACTION_GO:
|
||||
case EditorInfo.IME_ACTION_NEXT:
|
||||
case EditorInfo.IME_ACTION_PREVIOUS:
|
||||
case EditorInfo.IME_ACTION_SEARCH:
|
||||
case EditorInfo.IME_ACTION_SEND:
|
||||
return standardAction;
|
||||
default:
|
||||
switch (action) {
|
||||
case EditorInfo.IME_ACTION_UNSPECIFIED:
|
||||
case EditorInfo.IME_ACTION_DONE:
|
||||
return IME_ACTION_ENTER;
|
||||
default:
|
||||
return action;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue