Skip to content

Commit

Permalink
Add special treatment for space key
Browse files Browse the repository at this point in the history
When on a TextView for number, space key is not consumed by the
conversion engine (number characters are consumed).  Then MozcService
did fallback, sending ACTION_UP/DOWN of KeyEvent.KEYCODE_SPACE.

However sending such key events are not handled correctly by TextView
class.  As workaround, this CL commits space character instead.

BUG=
TEST=compile
REF_BUG=20036218
REF_CL=92514509
  • Loading branch information
matsuza committed Apr 30, 2015
1 parent a107834 commit f1d6885
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1322,7 +1322,13 @@ private static KeyEvent createKeyEvent(
}

// Otherwise, just delegates the key event to the connected application.
sendDownUpKeyEvents(keyCode);
// However space key needs special treatment because it is expected to produce space character
// instead of sending ACTION_DOWN/UP pair.
if (keyCode == KeyEvent.KEYCODE_SPACE) {
inputConnection.commitText(" ", 0);
} else {
sendDownUpKeyEvents(keyCode);
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/mozc_version_template.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MAJOR=2
MINOR=17
BUILD=2354
BUILD=2355
REVISION=102
# NACL_DICTIONARY_VERSION is the target version of the system dictionary to be
# downloaded by NaCl Mozc.
Expand Down

0 comments on commit f1d6885

Please sign in to comment.