Mercurial > 510Connectbot
comparison src/com/five_ten_sg/connectbot/service/TerminalKeyListener.java @ 149:eff82d6c11d9
add ptt button p2 preference
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Sun, 22 Jun 2014 13:04:37 -0700 |
parents | bc59a399f627 |
children | 86f903100573 |
comparison
equal
deleted
inserted
replaced
148:69333ca1563c | 149:eff82d6c11d9 |
---|---|
484 hwbuttonShortcut = manager.prefs.getString( | 484 hwbuttonShortcut = manager.prefs.getString( |
485 PreferenceConstants.SEARCH, | 485 PreferenceConstants.SEARCH, |
486 PreferenceConstants.HWBUTTON_ESC); | 486 PreferenceConstants.HWBUTTON_ESC); |
487 return (handleShortcut(v, hwbuttonShortcut)); | 487 return (handleShortcut(v, hwbuttonShortcut)); |
488 | 488 |
489 case KeyEvent.KEYCODE_BUTTON_L2: | |
490 // check to see which shortcut the ptt button triggers | |
491 hwbuttonShortcut = manager.prefs.getString( | |
492 PreferenceConstants.PTT, | |
493 PreferenceConstants.HWBUTTON_MONITOR); | |
494 return (handleShortcut(v, hwbuttonShortcut)); | |
495 | |
489 case KeyEvent.KEYCODE_DEL: | 496 case KeyEvent.KEYCODE_DEL: |
490 if ((metaState & META_ALT_MASK) != 0) { | 497 if ((metaState & META_ALT_MASK) != 0) { |
491 buffer.keyPressed(vt320.KEY_INSERT, ' ', getStateForBuffer()); | 498 buffer.keyPressed(vt320.KEY_INSERT, ' ', getStateForBuffer()); |
492 } | 499 } |
493 else { | 500 else { |
592 } | 599 } |
593 | 600 |
594 private boolean handleShortcut(View v, String shortcut) { | 601 private boolean handleShortcut(View v, String shortcut) { |
595 if (PreferenceConstants.HWBUTTON_SCREEN_CAPTURE.equals(shortcut)) { | 602 if (PreferenceConstants.HWBUTTON_SCREEN_CAPTURE.equals(shortcut)) { |
596 bridge.captureScreen(); | 603 bridge.captureScreen(); |
604 } | |
605 else if (PreferenceConstants.HWBUTTON_MONITOR.equals(shortcut)) { | |
606 buffer.monitorKey(true); // key down | |
597 } | 607 } |
598 else if (PreferenceConstants.HWBUTTON_CTRL.equals(shortcut)) { | 608 else if (PreferenceConstants.HWBUTTON_CTRL.equals(shortcut)) { |
599 showMetakeyToast(v, PreferenceConstants.HWBUTTON_CTRL); | 609 showMetakeyToast(v, PreferenceConstants.HWBUTTON_CTRL); |
600 metaPress(META_CTRL_ON); | 610 metaPress(META_CTRL_ON); |
601 } | 611 } |