Patch to make volume keys change volume instead of in-game action, by lmak
This commit is contained in:
@@ -103,4 +103,5 @@ class Globals {
|
||||
public static String DataDir = new String("");
|
||||
public static boolean SmoothVideo = false;
|
||||
public static boolean MultiThreadedVideo = false;
|
||||
public static int RemapKeymask = 0;
|
||||
}
|
||||
|
||||
@@ -325,10 +325,13 @@ public class MainActivity extends Activity {
|
||||
_screenKeyboard.onKeyDown(keyCode, event);
|
||||
else
|
||||
if( mGLView != null )
|
||||
mGLView.nativeKey( keyCode, 1 );
|
||||
{
|
||||
if( !mGLView.callNativeKey( keyCode, 1 ) )
|
||||
return super.onKeyDown(keyCode, event);
|
||||
}
|
||||
else
|
||||
if( keyCode == KeyEvent.KEYCODE_BACK && downloader != null )
|
||||
{
|
||||
{
|
||||
if( downloader.DownloadFailed )
|
||||
System.exit(1);
|
||||
if( !downloader.DownloadComplete )
|
||||
@@ -349,7 +352,10 @@ public class MainActivity extends Activity {
|
||||
_screenKeyboard.onKeyUp(keyCode, event);
|
||||
else
|
||||
if( mGLView != null )
|
||||
mGLView.nativeKey( keyCode, 0 );
|
||||
{
|
||||
if( !mGLView.callNativeKey( keyCode, 0 ) )
|
||||
return super.onKeyUp(keyCode, event);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -401,16 +401,28 @@ class DemoGLSurfaceView extends GLSurfaceView_SDL {
|
||||
|
||||
@Override
|
||||
public boolean onKeyDown(int keyCode, final KeyEvent event) {
|
||||
nativeKey( keyCode, 1 );
|
||||
return true;
|
||||
if( !callNativeKey( keyCode, 1 ) )
|
||||
return super.onKeyDown(keyCode, event);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onKeyUp(int keyCode, final KeyEvent event) {
|
||||
nativeKey( keyCode, 0 );
|
||||
return true;
|
||||
if( !callNativeKey( keyCode, 0 ) )
|
||||
return super.onKeyUp(keyCode, event);
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean callNativeKey(int keyCode, int down) {
|
||||
if( (Globals.RemapKeymask & keyCode ) == keyCode )
|
||||
{
|
||||
// no remap made for the key
|
||||
return false;
|
||||
}
|
||||
nativeKey( keyCode, down );
|
||||
return true;
|
||||
}
|
||||
|
||||
DemoRenderer mRenderer;
|
||||
MainActivity mParent;
|
||||
DifferentTouchInput touchInput = null;
|
||||
|
||||
Reference in New Issue
Block a user