Added PAGEUP and PAGEDOWN key movement

This commit is contained in:
Thomas Buckley-Houston 2018-02-17 15:02:50 +08:00
parent 8cf3de33c3
commit 8b042b2479
2 changed files with 10 additions and 3 deletions

View file

@ -142,11 +142,12 @@ func shutdown(err error) {
exitCode := 0 exitCode := 0
if err.Error() != "normal" { if err.Error() != "normal" {
exitCode = 1 exitCode = 1
} else {
println(err.Error())
} }
out := err.(*errors.Error).ErrorStack() out := err.(*errors.Error).ErrorStack()
log(fmt.Sprintf(out)) log(fmt.Sprintf(out))
screen.Fini() screen.Fini()
println(err.Error())
os.Exit(exitCode) os.Exit(exitCode)
} }

View file

@ -140,10 +140,16 @@ export default class FrameBuilder extends BaseBuilder{
_handleSpecialKeys(input) { _handleSpecialKeys(input) {
switch (input.key) { switch (input.key) {
case 257: // up arow case 257: // up arow
window.scrollBy(0, -20); window.scrollBy(0, -2 * this.char_height);
break; break;
case 258: // down arrow case 258: // down arrow
window.scrollBy(0, 20); window.scrollBy(0, 2 * this.char_height);
break;
case 266: // page up
window.scrollBy(0, -this.tty_height * this.char_height);
break;
case 267: // page down
window.scrollBy(0, this.tty_height * this.char_height);
break; break;
case 18: // CTRL+r case 18: // CTRL+r
window.location.reload(); window.location.reload();