diff --git a/interfacer/main.go b/interfacer/main.go index 108aea9a..ecf4443d 100644 --- a/interfacer/main.go +++ b/interfacer/main.go @@ -145,7 +145,6 @@ func readStdin() { } shutdown("normal") } - log(fmt.Sprintf("EventKey: k: %d, c: %c, mod: %s", ev.Key, ev.Ch, ev.Mod)) eventMap := map[string]interface{}{ "key": int(ev.Key), "char": string(ev.Ch), @@ -160,7 +159,6 @@ func readStdin() { termbox.Flush() sendTtySize() case termbox.EventMouse: - log(fmt.Sprintf("Mouse: k: %d, x: %d, y: %d, mod: %s", ev.Key, ev.MouseX, ev.MouseY, ev.Mod)) eventMap := map[string]interface{}{ "key": int(ev.Key), "mouse_x": int(ev.MouseX), @@ -262,7 +260,6 @@ func webSocketWriter(ws *websocket.Conn) { } shutdown(err.Error()) } - log(fmt.Sprintf("TTY sent: %s", message)) } } diff --git a/webext/src/background/tty_commands_mixin.js b/webext/src/background/tty_commands_mixin.js index 98384849..4649a04a 100644 --- a/webext/src/background/tty_commands_mixin.js +++ b/webext/src/background/tty_commands_mixin.js @@ -1,3 +1,4 @@ +import _ from 'lodash'; import utils from 'utils'; // Handle commands coming in from the terminal, like; STDIN keystrokes, TTY resize, etc @@ -25,7 +26,9 @@ export default (MixinBase) => class extends MixinBase { } // Trigger a faster feedback response // TODO: cancel the current FPS iteration when using this - this.sendToCurrentTab('/request_frame'); + _.throttle(() => { + this.sendToCurrentTab('/request_frame') + }, 50); break; case '/status': this.updateStatus('', parts.slice(1).join(',')); diff --git a/webext/src/dom/frame_builder.js b/webext/src/dom/frame_builder.js index 4da7894a..15ae5681 100644 --- a/webext/src/dom/frame_builder.js +++ b/webext/src/dom/frame_builder.js @@ -137,6 +137,12 @@ export default class FrameBuilder extends BaseBuilder{ case 65516: // down arrow window.scrollBy(0, 20); break; + case 65508: // scroll up + window.scrollBy(0, -20); + break; + case 65507: // scroll down + window.scrollBy(0, 20); + break; case 65512: // mousedown this._mouseAction('click', input.mouse_x, input.mouse_y); this._mouseAction('mousedown', input.mouse_x, input.mouse_y);