mirror of
https://github.com/etlegacy/etlegacy-android.git
synced 2024-11-10 06:52:06 +00:00
java: added ESC button
There is a small bug with it, if in game button seems to be unresponsive.
This commit is contained in:
parent
2ad621568c
commit
756a5bbadb
1 changed files with 15 additions and 0 deletions
|
@ -131,6 +131,21 @@ public class ETLActivity extends SDLActivity implements JoyStickListener
|
|||
|
||||
mLayout.addView(btn2, lp);
|
||||
|
||||
Button esc_btn = new Button(getApplicationContext());
|
||||
esc_btn.setText("ESC");
|
||||
esc_btn.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
SDLActivity.onNativeKeyDown(111);
|
||||
}
|
||||
});
|
||||
|
||||
RelativeLayout.LayoutParams lp2 = new RelativeLayout.LayoutParams(100, 95);
|
||||
|
||||
lp2.addRule(RelativeLayout.RIGHT_OF, btn.getId());
|
||||
|
||||
mLayout.addView(esc_btn, lp2);
|
||||
|
||||
JoyStick joyStick = new JoyStick(getApplicationContext());
|
||||
|
||||
joyStick.setListener(this);
|
||||
|
|
Loading…
Reference in a new issue