allow code execution from debug panel by pressing Ctrl+Enter on a hardware keyboard

This commit is contained in:
fkloft
2015-11-06 19:16:49 +01:00
parent 7dc7157266
commit ef34c38910

View File

@ -116,6 +116,16 @@ public class IITC_Mobile extends Activity
mViewDebug = findViewById(R.id.viewDebug); mViewDebug = findViewById(R.id.viewDebug);
mBtnToggleMap = (ImageButton) findViewById(R.id.btnToggleMapVisibility); mBtnToggleMap = (ImageButton) findViewById(R.id.btnToggleMapVisibility);
mEditCommand = (EditText) findViewById(R.id.editCommand); mEditCommand = (EditText) findViewById(R.id.editCommand);
mEditCommand.setOnKeyListener(new View.OnKeyListener() {
@Override
public boolean onKey(final View v, final int keyCode, final KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_ENTER && event.isCtrlPressed()) {
onBtnRunCodeClick(v);
return true;
}
return false;
}
});
mEditCommand.setOnEditorActionListener(new TextView.OnEditorActionListener() { mEditCommand.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override @Override
public boolean onEditorAction(final TextView v, final int actionId, final KeyEvent event) { public boolean onEditorAction(final TextView v, final int actionId, final KeyEvent event) {