File tree Expand file tree Collapse file tree
src/pandroid/app/src/main/java/com/panda3ds/pandroid Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -151,12 +151,8 @@ protected void onPause() {
151151 }
152152
153153 @ Override
154- public boolean dispatchKeyEvent (KeyEvent event ) {
155- if (event .getKeyCode () == KeyEvent .KEYCODE_VOLUME_UP || event .getKeyCode () == KeyEvent .KEYCODE_VOLUME_DOWN ) {
156- return super .dispatchKeyEvent (event );
157- }
158-
159- if ((!drawerFragment .isOpened ()) && InputHandler .processKeyEvent (event )) {
154+ public boolean dispatchKeyEvent (KeyEvent event ) {
155+ if ((!drawerFragment .isOpened ()) && InputHandler .processKeyEvent (event , true )) {
160156 return true ;
161157 }
162158
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ public boolean dispatchGenericMotionEvent(MotionEvent ev) {
4747
4848 @ Override
4949 public boolean dispatchKeyEvent (KeyEvent event ) {
50- return InputHandler .processKeyEvent (event );
50+ return InputHandler .processKeyEvent (event , false );
5151 }
5252
5353 private void onInputEvent (InputEvent event ) {
Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ public static boolean processMotionEvent(MotionEvent event) {
9090 return true ;
9191 }
9292
93- public static boolean processKeyEvent (KeyEvent event ) {
93+ public static boolean processKeyEvent (KeyEvent event , Boolean playing ) {
9494 if (!isSourceValid (event .getSource ())) {
9595 return false ;
9696 }
@@ -110,6 +110,13 @@ public static boolean processKeyEvent(KeyEvent event) {
110110 }
111111 }
112112 String code = KeyEvent .keyCodeToString (event .getKeyCode ());
113+
114+ if (playing == true ) {
115+ if (InputMap .relative (code ) == KeyName .NULL ) {
116+ return false ;
117+ }
118+ }
119+
113120 if (event .getAction () == KeyEvent .ACTION_UP ) {
114121 keyDownEvents .remove (code );
115122 handleEvent (new InputEvent (code , 0.0f ));
You can’t perform that action at this time.
0 commit comments