diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2015-02-19 16:07:00 +0900 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-02-23 10:10:27 +0100 |
commit | c16de577de20d3f655b38e84509966fbaad548da (patch) | |
tree | 86df544bea33e37a3f3cf4daa088ccbee0489bf6 /android | |
parent | 89e9e70462d67b27682edc6b9eeded4e66ec293f (diff) |
android: support ACTION_MULTIPLE KeyEvent
With ACTION_MULTIPLE more characters have been entered at the same
time. In this case we send more key press events to LO for now.
This is generally useful for IME input but Android also sends this
if non-ASCII key has been hit - even when the key is only one
character.
Change-Id: Iaf48ed4e40b8e4413ed5735add34870ec263b61d
Diffstat (limited to 'android')
-rw-r--r-- | android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java index 4e5a8423d1ac..97fb009a4cb2 100644 --- a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java +++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java @@ -315,7 +315,15 @@ public class LOKitTileProvider implements TileProvider, Document.MessageCallback @Override public void keyPress(KeyEvent keyEvent) { - mOffice.postKeyEvent(Office.KEY_PRESS, getCharCode(keyEvent), getKeyCode(keyEvent)); + if (keyEvent.getAction() == KeyEvent.ACTION_MULTIPLE) { + String keyString = keyEvent.getCharacters(); + for (int i = 0; i < keyString.length(); i++) { + int codePoint = keyString.codePointAt(i); + mOffice.postKeyEvent(Office.KEY_PRESS, codePoint, getKeyCode(keyEvent)); + } + } else { + mOffice.postKeyEvent(Office.KEY_PRESS, getCharCode(keyEvent), getKeyCode(keyEvent)); + } } @Override |