Updated the PDP-11 SerialPort to support ALT-ENTER for LINE-FEED and ALT-DELETE for BACKSPACE, to stay in step with VT100 shortcuts

This commit is contained in:
Jeff Parsons 2016-11-27 13:48:23 -08:00 • committed by Jeff Parsons
commit 469d446ab7
14 changed files with 331 additions and 280 deletions

View file

@ -0,0 +1,18 @@
---
layout: page
title: PDP-11/70 with Front Panel and Debugger
permalink: /devices/pdp11/machine/1170/panel/debugger/rsts/
machines:
- id: test1170
type: pdp11
config: /devices/pdp11/machine/1170/panel/debugger/machine.xml
debugger: true
autoStart: true
autoMount:
RL0:
path: http://archive.pcjs.org/disks/dec/rl01k/RL01K-RSTS-V70.json
---
This machine is ready to boot [RSTS/E v7.0](/disks/dec/rl01k/rstsv70/) ("BOOT RL0").
{% include machine.html id="test1170" %}

View file

@ -3,7 +3,7 @@
<control type="container">
<control type="list" binding="listDrives"/>
<control type="list" binding="listDisks">
<disk id="disk01" name="RSTS/E v7.0" path="http://archive.pcjs.org/disks/dec/rl01k/RL01K-RSTSE-V70.json"/>
<disk id="disk01" name="RSTS/E v7.0" path="http://archive.pcjs.org/disks/dec/rl01k/RL01K-RSTS-V70.json"/>
<disk id="disk02" name="XXDP+ Diagnostics" path="http://archive.pcjs.org/disks/dec/rl02k/RL02K-XXDP.json"/>
</control>
<control type="button" binding="loadDrive">Load</control>

View file

@ -11,4 +11,4 @@ RL01K disks are single-platter cartridges with 256 tracks per side, 40 sectors p
256 bytes, for a total capacity of 5Mb (5,242,880 bytes). They are used in RL01 disk drives in conjunction
with an [RL11 Disk Controller](/devices/pdp11/rl11/).
* [RSTS/E v7.0](rstsev70/) [[Source](http://skn.noip.me/pdp11/): RL2.DSK]
* [RSTS/E v7.0](rstsv70/) [[Source](http://skn.noip.me/pdp11/): RL2.DSK]

View file

@ -1,7 +1,7 @@
---
layout: page
title: "RL01K RSTS/E v7.0 Disk"
permalink: /disks/dec/rl01k/rstsev70/
permalink: /disks/dec/rl01k/rstsv70/
---
RL01K RSTS/E v7.0 Disk

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -199,34 +199,58 @@ SerialPortPDP11.prototype.setBinding = function(sType, sBinding, control, sValue
* An onkeydown handler is required for certain keys that browsers tend to consume themselves;
* for example, BACKSPACE is often defined as going back to the previous web page, and certain
* CTRL keys are often used for browser shortcuts (usually on Windows-based browsers).
*
* NOTE: We don't bother with a keyUp handler, because for the most part, we're only intercepting
* keys that require special treatment; in general, we're content with keyPress events.
*/
control.onkeydown = function onKeyDown(event) {
event = event || window.event;
var fProcess = false;
var bASCII = 0;
var keyCode = event.keyCode;
/*
* Perform the same remapping of BACKSPACE and DELETE that our VT100 emulation performs,
* for PCjs-wide consistency; see the KEYMAP table in /modules/pc8080/lib/keyboard.js for
* the rationale. Ditto for ALT-DELETE; see onKeyDown() in /modules/pc8080/lib/keyboard.js
* for details.
*
* NOTE: keyDown (and keyUp) events supply us with KEYCODE values, which are NOT the same as
* ASCII values, which is why we are comparing with KEYCODE values but assigning ASCII values,
* because receiveData() requires ASCII values.
*/
if (keyCode == Keys.KEYCODE.BS) {
fProcess = true;
keyCode = Keys.ASCII.DEL;
bASCII = event.altKey? Keys.ASCII.CTRL_H : Keys.ASCII.DEL;
}
else if (keyCode == Keys.KEYCODE.DEL) {
bASCII = Keys.ASCII.CTRL_H;
}
else if (event.ctrlKey && keyCode >= Keys.ASCII.A && keyCode <= Keys.ASCII.Z) {
fProcess = true;
keyCode -= (Keys.ASCII.A - Keys.ASCII.CTRL_A);
bASCII = keyCode - (Keys.ASCII.A - Keys.ASCII.CTRL_A);
}
if (fProcess) {
if (bASCII) {
if (event.preventDefault) event.preventDefault();
serial.receiveData(keyCode);
serial.receiveData(bASCII);
}
return true;
};
control.onkeypress = function onKeyPress(event) {
/*
* Browser-independent keyCode extraction; refer to onKeyPress() and the other key event
* handlers in keyboard.js.
* NOTE: Unlike keyDown events, keyPress events generally supply us with ASCII values,
* despite the fact that, as above, they come to us via the keyCode property. Yes, it's
* brilliant (or rather, the opposite of brilliant), but that's life.
*/
event = event || window.event;
var keyCode = event.which || event.keyCode;
serial.receiveData(keyCode);
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 <textarea> control
* (so that the soft keyboard activates on iOS), instead of calling preventDefault() for
@ -512,20 +536,20 @@ SerialPortPDP11.prototype.receiveData = function(data)
this.abReceive.push(data);
}
else if (typeof data == "string") {
var b = 0, bPrev;
var bASCII = 0, bASCIIPrev;
for (var i = 0; i < data.length; i++) {
bPrev = b;
b = data.charCodeAt(i);
bASCIIPrev = bASCII;
bASCII = data.charCodeAt(i);
/*
* NOTE: Multiple lines of pasted text will (at least on macOS) contain LFs instead of CRs;
* we convert them to CRs below. Windows may do something different, but in the worst case,
* even if we receive CR/LF pairs, this code should keep the CRs and lose the LFs.
*/
if (b == str.ASCII.LF) {
if (bPrev == str.ASCII.CR) continue;
b = str.ASCII.CR;
if (bASCII == str.ASCII.LF) {
if (bASCIIPrev == str.ASCII.CR) continue;
bASCII = str.ASCII.CR;
}
this.abReceive.push(b);
this.abReceive.push(bASCII);
}
}
else {

View file

@ -37,7 +37,10 @@ var Keys = {
* is why I've 'unquoted' as many of them as possible.
*/
ASCII: {
CTRL_A: 1, CTRL_C: 3, CTRL_Z: 26,
BREAK: 0, CTRL_A: 1, CTRL_B: 2, CTRL_C: 3, CTRL_D: 4, CTRL_E: 5, CTRL_F: 6, CTRL_G: 7,
CTRL_H: 8, CTRL_I: 9, CTRL_J: 10, CTRL_K: 11, CTRL_L: 12, CTRL_M: 13, CTRL_N: 14, CTRL_O: 15,
CTRL_P: 16, CTRL_Q: 17, CTRL_R: 18, CTRL_S: 19, CTRL_T: 20, CTRL_U: 21, CTRL_V: 22, CTRL_W: 23,
CTRL_X: 24, CTRL_Y: 25, CTRL_Z: 26,
' ': 32, '!': 33, '"': 34, '#': 35, '$': 36, '%': 37, '&': 38, "'": 39,
'(': 40, ')': 41, '*': 42, '+': 43, ',': 44, '-': 45, '.': 46, '/': 47,
'0': 48, '1': 49, '2': 50, '3': 51, '4': 52, '5': 53, '6': 54, '7': 55,

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long