Fix Typo (KeyEvent.KEYCODE_DEL and others)

This commit is contained in:
Robert Vanden Eynde
2018-08-01 05:05:40 +02:00
committed by Fredrik Fornwall
parent 55efdb2f56
commit 49c051c8b7

View File

@@ -66,7 +66,7 @@ public final class ExtraKeysView extends GridLayout {
put("PGDN", KeyEvent.KEYCODE_PAGE_DOWN); put("PGDN", KeyEvent.KEYCODE_PAGE_DOWN);
put("INS", KeyEvent.KEYCODE_INSERT); put("INS", KeyEvent.KEYCODE_INSERT);
put("DEL", KeyEvent.KEYCODE_FORWARD_DEL); put("DEL", KeyEvent.KEYCODE_FORWARD_DEL);
put("BKSP", KeyEvent.KEYCODE_BACKWARD_DEL); put("BKSP", KeyEvent.KEYCODE_DEL);
put("UP", KeyEvent.KEYCODE_DPAD_UP); put("UP", KeyEvent.KEYCODE_DPAD_UP);
put("LEFT", KeyEvent.KEYCODE_DPAD_LEFT); put("LEFT", KeyEvent.KEYCODE_DPAD_LEFT);
put("RIGHT", KeyEvent.KEYCODE_DPAD_RIGHT); put("RIGHT", KeyEvent.KEYCODE_DPAD_RIGHT);
@@ -84,7 +84,7 @@ public final class ExtraKeysView extends GridLayout {
// not a control char // not a control char
TerminalSession session = terminalView.getCurrentSession(); TerminalSession session = terminalView.getCurrentSession();
if (session != null) if (session != null)
session.write(KeyName); session.write(keyName);
} }
} }
@@ -381,6 +381,7 @@ public final class ExtraKeysView extends GridLayout {
}, 400, 80, TimeUnit.MILLISECONDS); }, 400, 80, TimeUnit.MILLISECONDS);
} }
return true; return true;
case MotionEvent.ACTION_MOVE: case MotionEvent.ACTION_MOVE:
// These two keys have a Move-Up button appearing // These two keys have a Move-Up button appearing
if (Arrays.asList("/", "-").contains(buttonText)) { if (Arrays.asList("/", "-").contains(buttonText)) {
@@ -396,6 +397,7 @@ public final class ExtraKeysView extends GridLayout {
} }
} }
return true; return true;
case MotionEvent.ACTION_UP: case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL: case MotionEvent.ACTION_CANCEL:
v.setBackgroundColor(BUTTON_COLOR); v.setBackgroundColor(BUTTON_COLOR);
@@ -414,6 +416,7 @@ public final class ExtraKeysView extends GridLayout {
} }
} }
return true; return true;
default: default:
return true; return true;
} }
@@ -422,7 +425,7 @@ public final class ExtraKeysView extends GridLayout {
LayoutParams param = new GridLayout.LayoutParams(); LayoutParams param = new GridLayout.LayoutParams();
param.width = 0; param.width = 0;
if(Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP) { //special handle api 21 if(Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP) { // special handle api 21
param.height = (int)(37.5 * getResources().getDisplayMetrics().density + 0.5); // 37.5 equal to R.id.viewpager layout_height / rows in DP param.height = (int)(37.5 * getResources().getDisplayMetrics().density + 0.5); // 37.5 equal to R.id.viewpager layout_height / rows in DP
} else { } else {
param.height = 0; param.height = 0;