From 07cfa465006f301ea04cc51db3432837b477d8c0 Mon Sep 17 00:00:00 2001 From: Bryan Roe Date: Thu, 15 Aug 2019 23:52:27 -0700 Subject: [PATCH] Fixed bug where VkKeyScan wasnt properly masking the results --- modules/win-terminal.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/win-terminal.js b/modules/win-terminal.js index d5e1e10..437df13 100644 --- a/modules/win-terminal.js +++ b/modules/win-terminal.js @@ -399,8 +399,8 @@ function windows_terminal() { } this._WriteCharacter = function (key, bControlKey) { - var scanCode = this._user32.VkKeyScanA(key).Val; - if (scanCode < 0 || scanCode > 255) { return; } + var scanCode = this._user32.VkKeyScanA(key).Val & 0xFF; + if (key == 10) { return; } var rec = GM.CreateVariable(20); rec.Deref(0, 2).toBuffer().writeUInt16LE(KEY_EVENT); // rec.EventType