keyChar(final char key, final int status, final int time) {
if (key == 'n') {
final Runnable nextRunnable = new Runnable() {
public void run() {
try {
final BrowserFieldHistory browserFieldHistory =
getBrowserField().getHistory();
if (browserFieldHistory.canGoForward()) {
browserFieldHistory.goForward();
}
} catch (final Exception e) {
System.out.println("Error executing js:next(): "
+ e.getMessage());
}
}
};
new Thread(nextRunnable).start();
return true;
} else if (key == 'p' || key == Characters.ESCAPE) {
final Runnable previousRunnable = new Runnable() {
public void run() {
try {
final BrowserFieldHistory browserFieldHistory =
getBrowserField().getHistory();
if (browserFieldHistory.canGoBack()) {
browserFieldHistory.goBack();
} else {
if (key == Characters.ESCAPE) {
synchronized (Application.getEventLock()) {
close();
}