Mercurial > 510Connectbot
comparison src/com/five_ten_sg/connectbot/service/TerminalKeyListener.java @ 112:77ac18bc1b2f
cleanup java formatting
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Wed, 18 Jun 2014 13:03:01 -0700 |
parents | 8ac79084875b |
children | bc59a399f627 |
comparison
equal
deleted
inserted
replaced
111:6a0ad4d384ea | 112:77ac18bc1b2f |
---|---|
122 buffer.keyPressed(vt320.KEY_ESCAPE, ' ', getStateForBuffer()); | 122 buffer.keyPressed(vt320.KEY_ESCAPE, ' ', getStateForBuffer()); |
123 } | 123 } |
124 | 124 |
125 protected void sendEncoded(String s) { | 125 protected void sendEncoded(String s) { |
126 byte [] b = null; | 126 byte [] b = null; |
127 | |
127 try { | 128 try { |
128 b = s.getBytes(encoding); | 129 b = s.getBytes(encoding); |
129 } | 130 } |
130 catch (UnsupportedEncodingException e){ | 131 catch (UnsupportedEncodingException e) { |
131 } | 132 } |
133 | |
132 if (b != null) buffer.write(b); | 134 if (b != null) buffer.write(b); |
133 } | 135 } |
134 | 136 |
135 /** | 137 /** |
136 * Handle onKey() events coming down from a {@link com.five_ten_sg.connectbot.TerminalView} above us. | 138 * Handle onKey() events coming down from a {@link com.five_ten_sg.connectbot.TerminalView} above us. |
137 * Modify the keys to make more sense to a host then pass it to the vt320. | 139 * Modify the keys to make more sense to a host then pass it to the vt320. |
138 */ | 140 */ |
139 public boolean onKey(View v, int keyCode, KeyEvent event) { | 141 public boolean onKey(View v, int keyCode, KeyEvent event) { |
140 Log.d(TAG, String.format("onKey with key %d", keyCode)); | 142 Log.d(TAG, String.format("onKey with key %d", keyCode)); |
143 | |
141 try { | 144 try { |
142 // skip keys if we aren't connected yet or have been disconnected | 145 // skip keys if we aren't connected yet or have been disconnected |
143 if (bridge.isDisconnected()) return false; | 146 if (bridge.isDisconnected()) return false; |
144 | 147 |
145 // Ignore all key-up events except for the special keys | 148 // Ignore all key-up events except for the special keys |
584 } | 587 } |
585 catch (NullPointerException npe) { | 588 catch (NullPointerException npe) { |
586 Log.d(TAG, "Input before connection established ignored."); | 589 Log.d(TAG, "Input before connection established ignored."); |
587 return true; | 590 return true; |
588 } | 591 } |
592 | |
589 return false; | 593 return false; |
590 } | 594 } |
591 | 595 |
592 private boolean handleShortcut(View v, String shortcut) { | 596 private boolean handleShortcut(View v, String shortcut) { |
593 if (PreferenceConstants.HWBUTTON_SCREEN_CAPTURE.equals(shortcut)) { | 597 if (PreferenceConstants.HWBUTTON_SCREEN_CAPTURE.equals(shortcut)) { |