mirror of
https://github.com/etlegacy/etlegacy-android.git
synced 2024-11-10 06:52:06 +00:00
java: add ~ to the popup menu
This is workaround since softkeyboard tilde seems not to work at all.
This commit is contained in:
parent
cd8edbb4de
commit
1fa1c6d2c2
1 changed files with 7 additions and 3 deletions
|
@ -91,18 +91,22 @@ public class ETLActivity extends SDLActivity implements JoyStickListener {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
PopupMenu etl_PopMenu = new PopupMenu(getApplicationContext(), buttonPopUpMenu);
|
PopupMenu etl_PopMenu = new PopupMenu(getApplicationContext(), buttonPopUpMenu);
|
||||||
etl_PopMenu.getMenu().add(0, 0, 0, "F1");
|
etl_PopMenu.getMenu().add(0, 0, 0, "~");
|
||||||
etl_PopMenu.getMenu().add(1, 1, 1, "F2");
|
etl_PopMenu.getMenu().add(1, 1, 1, "F1");
|
||||||
|
etl_PopMenu.getMenu().add(2, 2, 2, "F2");
|
||||||
etl_PopMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
|
etl_PopMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onMenuItemClick(MenuItem item) {
|
public boolean onMenuItemClick(MenuItem item) {
|
||||||
|
|
||||||
switch (item.getItemId()) {
|
switch (item.getItemId()) {
|
||||||
case 0:
|
case 0:
|
||||||
|
SDLActivity.onNativeKeyDown(68);
|
||||||
|
SDLActivity.onNativeKeyUp(68);
|
||||||
|
case 1:
|
||||||
SDLActivity.onNativeKeyDown(131);
|
SDLActivity.onNativeKeyDown(131);
|
||||||
SDLActivity.onNativeKeyUp(131);
|
SDLActivity.onNativeKeyUp(131);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 2:
|
||||||
SDLActivity.onNativeKeyDown(132);
|
SDLActivity.onNativeKeyDown(132);
|
||||||
SDLActivity.onNativeKeyUp(132);
|
SDLActivity.onNativeKeyUp(132);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue