Skip to content

Commit eeb8513

Browse files
committed
FIXED ISSUE #25 : Enhancement: Do not output space when changing keyboard V2
1 parent 0c2596a commit eeb8513

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/src/main/java/com/gazlaws/codeboard/CodeBoardIME.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ public void onKey(int primaryCode, int[] KeyCodes) {
187187
ke = KeyEvent.KEYCODE_ESCAPE;
188188
break;
189189
case 32:
190-
longPressedSpaceButton = false;
191190
ke = KeyEvent.KEYCODE_SPACE;
192191
break;
193192
case -5:
@@ -283,7 +282,7 @@ public void onKey(int primaryCode, int[] KeyCodes) {
283282
* Reason being that we first want to check
284283
* whether the space button has been long pressed or not
285284
* and afterwards produce the right output to the screen.
286-
* Note : The ACTION_UP KeyEvent doesn't bother us either way.
285+
* TODO: Investigate whether KeyEvent.ACTION_UP is still required.
287286
*/
288287
if (primaryCode != 32) { ic.sendKeyEvent (new KeyEvent (0, 0, KeyEvent.ACTION_DOWN, ke, 0, meta)); }
289288

@@ -368,6 +367,8 @@ public void onRelease(int primaryCode) {
368367
ic.commitText (String.valueOf ((char) primaryCode), 1);
369368
}
370369

370+
longPressedSpaceButton = false;
371+
371372
clearLongPressTimer();
372373
}
373374

0 commit comments

Comments
 (0)