mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-17 16:47:14 -04:00
Fix mouse back button not properly detected on menus
This commit is contained in:
parent
e874fe236f
commit
ebbd935cfe
@ -627,7 +627,11 @@ 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() != null && (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
|
||||
|| (event.getDevice().getSources() & InputDevice.SOURCE_MOUSE) == InputDevice.SOURCE_MOUSE) ){
|
||||
|
||||
|
||||
if(event.getKeyCode() == KeyEvent.KEYCODE_BACK){
|
||||
sendMouseButton(LWJGLGLFWKeycode.GLFW_MOUSE_BUTTON_RIGHT, event.getAction() == KeyEvent.ACTION_DOWN);
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user