Android: test for SOURCE_KEYBOARD / SOURCE_MOUSE. Don't compare to 0, since there are several bits (see #5322, #2718)
parent
7935cfacc5
commit
1fc5dba3d5
|
@ -1905,7 +1905,7 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((source & InputDevice.SOURCE_KEYBOARD) != 0) {
|
if ((source & InputDevice.SOURCE_KEYBOARD) == InputDevice.SOURCE_KEYBOARD) {
|
||||||
if (event.getAction() == KeyEvent.ACTION_DOWN) {
|
if (event.getAction() == KeyEvent.ACTION_DOWN) {
|
||||||
if (SDLActivity.isTextInputEvent(event)) {
|
if (SDLActivity.isTextInputEvent(event)) {
|
||||||
SDLInputConnection.nativeCommitText(String.valueOf((char) event.getUnicodeChar()), 1);
|
SDLInputConnection.nativeCommitText(String.valueOf((char) event.getUnicodeChar()), 1);
|
||||||
|
@ -1918,7 +1918,7 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((source & InputDevice.SOURCE_MOUSE) != 0) {
|
if ((source & InputDevice.SOURCE_MOUSE) == InputDevice.SOURCE_MOUSE) {
|
||||||
// on some devices key events are sent for mouse BUTTON_BACK/FORWARD presses
|
// on some devices key events are sent for mouse BUTTON_BACK/FORWARD presses
|
||||||
// they are ignored here because sending them as mouse input to SDL is messy
|
// they are ignored here because sending them as mouse input to SDL is messy
|
||||||
if ((keyCode == KeyEvent.KEYCODE_BACK) || (keyCode == KeyEvent.KEYCODE_FORWARD)) {
|
if ((keyCode == KeyEvent.KEYCODE_BACK) || (keyCode == KeyEvent.KEYCODE_FORWARD)) {
|
||||||
|
|
Loading…
Reference in New Issue