mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-28 02:30:05 +00:00
Android: Added a virtual backButtonPressed() method to JUCEApplicationBase which can be overridden to be informed when the back button is pressed on a device.
This commit is contained in:
parent
b77a0786fb
commit
201a85acd7
3 changed files with 22 additions and 1 deletions
|
|
@ -630,6 +630,7 @@ public class JuceAppActivity extends Activity
|
|||
//==============================================================================
|
||||
private native void handleKeyDown (long host, int keycode, int textchar);
|
||||
private native void handleKeyUp (long host, int keycode, int textchar);
|
||||
private native void handleBackButton (long host);
|
||||
|
||||
public void showKeyboard (String type)
|
||||
{
|
||||
|
|
@ -657,8 +658,14 @@ public class JuceAppActivity extends Activity
|
|||
case KeyEvent.KEYCODE_VOLUME_UP:
|
||||
case KeyEvent.KEYCODE_VOLUME_DOWN:
|
||||
return super.onKeyDown (keyCode, event);
|
||||
case KeyEvent.KEYCODE_BACK:
|
||||
{
|
||||
handleBackButton (host);
|
||||
return true;
|
||||
}
|
||||
|
||||
default: break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
handleKeyDown (host, keyCode, event.getUnicodeChar());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue