Add Ctrl+C and Ctrl+Z support to gui console.

git-svn-id: file:///home/svn/framework3/trunk@10641 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
Matt Weeks 2010-10-11 15:57:01 +00:00
parent b6c4d1fc00
commit e981b89ed4
2 changed files with 12 additions and 0 deletions

Binary file not shown.

View File

@ -334,6 +334,18 @@ public class InteractWindow extends MsfFrame {
}else if(evt.getKeyCode() == KeyEvent.VK_DOWN){
currentCommand = (currentCommand + 1) % commands.size();
inputField.setText(commands.get(currentCommand).toString());
}else if (evt.isControlDown() && cmdPrefix.equals("console.")) {
try {
if (evt.getKeyCode() == KeyEvent.VK_C){
rpcConn.execute("console.session_kill", session.get("id"));
outputArea.append("killing session...\n");
}else if (evt.getKeyCode() == KeyEvent.VK_Z){
rpcConn.execute("console.session_detach", session.get("id"));
outputArea.append("backgrounding session...\n");
}
} catch (MsfException ex) {
JOptionPane.showMessageDialog(null, ex);
}
}
}//GEN-LAST:event_inputFieldKeyPressed