mirror of
https://github.com/2009scape/2009Scape-mobile.git
synced 2025-12-19 21:10:11 -07:00
Fixes #1804: Handle null input devices
This commit is contained in:
parent
c09b80e55c
commit
8ca3e61a9e
1 changed files with 1 additions and 1 deletions
|
|
@ -627,7 +627,7 @@ public class BaseMainActivity extends LoggableActivity {
|
|||
if(event.getRepeatCount() != 0 || event.getAction() == KeyEvent.ACTION_MULTIPLE || event.getKeyCode() == KeyEvent.KEYCODE_UNKNOWN || (event.getFlags() & KeyEvent.FLAG_FALLBACK) == KeyEvent.FLAG_FALLBACK) return true;
|
||||
|
||||
//Sometimes, key events may come from the mouse
|
||||
if((event.getDevice().getSources() & InputDevice.SOURCE_MOUSE_RELATIVE) == InputDevice.SOURCE_MOUSE_RELATIVE){
|
||||
if(event.getDevice() != null && (event.getDevice().getSources() & InputDevice.SOURCE_MOUSE_RELATIVE) == InputDevice.SOURCE_MOUSE_RELATIVE){
|
||||
if(event.getKeyCode() == KeyEvent.KEYCODE_BACK){
|
||||
sendMouseButton(LWJGLGLFWKeycode.GLFW_MOUSE_BUTTON_RIGHT, event.getAction() == KeyEvent.ACTION_DOWN);
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue