$ssh = new Net_SSH2($address, $port);
if (!$ssh->login($user, $pass)) {
exit('Login Failed');
}
echo "<pre>";
$ssh->setTimeout(5);
echo $ssh->read();
$ssh->write($app_name);
$ssh->write("\n \n \n b");
$ssh->write($f_one); // This is where I need to hit F1
echo $ssh->read();
I’ve searched and found chr() might be my solution but the decial character code for the function keys includes a comma (is a pair: 00,59) which chr() splits as separate arguments and fails.
This is where I found the decimal pair, if it’s correct.
http://www.jimprice.com/jim-asc.shtml#keycodes
Following a post in this thread.
http://www.velocityreviews.com/forums/t277457-re-ascii-code-for-functions-keys-f1-f12-and-tab-key.html
Any help or a point in the right direction would be greatly appreciated.
The key code list you’re looking at is talking about keyboard scan codes, which are something completely different and unrelated.
The VT100 sequences for function keys are… complicated. F1 through F4 are typically sent as:
However, this pattern does not hold for subsequent function keys. For a more complete list, see http://rtfm.etla.org/xterm/ctlseq.html (search for “12 function keys”, note that
CSIrepresents the sequence\x1b[.)