From 166dfee473e38c3948a6dd6bb9584d01799a6a59 Mon Sep 17 00:00:00 2001 From: Jeff Parsons Date: Thu, 8 Dec 2016 21:36:29 -0800 Subject: [PATCH] Like the PC8080's VT100, let's make sure that no "meta" key combinations slip into the simulated terminal window (strangely, it appears limited to Safari) --- modules/pdp11/lib/serialport.js | 36 +++++++++++++++++------------- versions/pdpjs/1.30.6/pdp11-dbg.js | 2 +- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/modules/pdp11/lib/serialport.js b/modules/pdp11/lib/serialport.js index 180a6bb81..786f550ca 100644 --- a/modules/pdp11/lib/serialport.js +++ b/modules/pdp11/lib/serialport.js @@ -242,25 +242,31 @@ SerialPortPDP11.prototype.setBinding = function(sType, sBinding, control, sValue * brilliant (or rather, the opposite of brilliant), but that's life. */ event = event || window.event; - var bASCII = event.which || event.keyCode; /* - * Perform the same remapping of ALT-ENTER (to LINE-FEED) that our VT100 emulation performs, - * for PCjs-wide consistency; see onKeyDown() in /modules/pc8080/lib/keyboard.js for details. + * Not sure why COMMAND-key combinations are coming through here (on Safari at least), + * but in any case, let's make sure we don't act on them. */ - if (event.altKey) { - if (bASCII == Keys.ASCII.CTRL_M) { - bASCII = Keys.ASCII.CTRL_J; + if (!event.metaKey) { + var bASCII = event.which || event.keyCode; + /* + * Perform the same remapping of ALT-ENTER (to LINE-FEED) that our VT100 emulation performs, + * for PCjs-wide consistency; see onKeyDown() in /modules/pc8080/lib/keyboard.js for details. + */ + if (event.altKey) { + if (bASCII == Keys.ASCII.CTRL_M) { + bASCII = Keys.ASCII.CTRL_J; + } } + serial.receiveData(bASCII); + /* + * Since we're going to remove the "readonly" attribute from the