Skip to content
This repository has been archived by the owner on Dec 24, 2020. It is now read-only.

Commit

Permalink
Fixed DELETE/BACKSPACE confusion in the VT100 KEYMAP (by of course ma…
Browse files Browse the repository at this point in the history
…pping BACKSPACE to DELETE and DELETE to BACKSPACE; makes perfect sense)
  • Loading branch information
jeffpar committed Nov 23, 2016
1 parent eb993df commit a47c88f
Show file tree
Hide file tree
Showing 45 changed files with 13,694 additions and 3 deletions.
17 changes: 14 additions & 3 deletions modules/pc8080/lib/keyboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,20 @@ Keyboard8080.VT100 = {
};

/*
* Table to map host key codes to VT100 key addresses (ie, unique 7-bit values representing key positions on the VT100)
* Table mapping host key codes to VT100 key addresses (7-bit values representing key positions on the VT100)
*
* NOTE: The VT100 keyboard has both BACKSPACE and DELETE keys, whereas modern keyboards generally only
* have DELETE. And sadly, when you press DELETE, your modern keyboard and/or modern browser is reporting
* it as keyCode 8: the code for BACKSPACE, aka CTRL-H. You have to press a modified DELETE key to get
* the actual DELETE keyCode of 127.
*
* We resolve this below by mapping KEYCODE.BS (8) to VT100 keyCode DELETE (0x03) and KEYCODE.DEL (127)
* to VT100 keyCode BACKSPACE (0x33). So, DELETE is BACKSPACE and BACKSPACE is DELETE. Fortunately, this
* confusion is all internal, because your physical key is (or should be) labeled DELETE, so the fact that
* the browser is converting it to BACKSPACE and that we're converting BACKSPACE back into DELETE is
* something most people don't need to worry their heads about.
*/
Keyboard8080.VT100.KEYMAP[Keys.KEYCODE.DEL] = 0x03;
Keyboard8080.VT100.KEYMAP[Keys.KEYCODE.BS] = 0x03;
Keyboard8080.VT100.KEYMAP[Keys.ASCII.P] = 0x05;
Keyboard8080.VT100.KEYMAP[Keys.ASCII.O] = 0x06;
Keyboard8080.VT100.KEYMAP[Keys.ASCII.Y] = 0x07;
Expand Down Expand Up @@ -179,7 +190,7 @@ Keyboard8080.VT100.KEYMAP[Keys.KEYCODE.ESC] = 0x2A;
Keyboard8080.VT100.KEYMAP[Keys.KEYCODE.UP] = 0x30;
Keyboard8080.VT100.KEYMAP[Keys.KEYCODE.F3] = 0x31; // aka PF3
Keyboard8080.VT100.KEYMAP[Keys.KEYCODE.F1] = 0x32; // aka PF1
Keyboard8080.VT100.KEYMAP[Keys.KEYCODE.BS] = 0x33;
Keyboard8080.VT100.KEYMAP[Keys.KEYCODE.DEL] = 0x33;
Keyboard8080.VT100.KEYMAP[Keys.KEYCODE.EQUALS] = 0x34;
Keyboard8080.VT100.KEYMAP[Keys.KEYCODE.ZERO] = 0x35;
Keyboard8080.VT100.KEYMAP[Keys.KEYCODE.EIGHT] = 0x36;
Expand Down
190 changes: 190 additions & 0 deletions versions/c1pjs/1.30.4/c1p-dbg.js

Large diffs are not rendered by default.

150 changes: 150 additions & 0 deletions versions/c1pjs/1.30.4/c1p.js

Large diffs are not rendered by default.

265 changes: 265 additions & 0 deletions versions/c1pjs/1.30.4/common.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,265 @@
@CHARSET "UTF-8";
/**
@author Jeff Parsons (@jeffpar)
@website http://www.pcjs.org/
@created 2013-05-05
@modified 2014-02-23
@license http://www.gnu.org/licenses/gpl.html
*/
body {
margin: 0;
background: #202020;
}
h1, h2 {
margin-top: 0;
color: #cccccc;
}
h1, h2, h3, h4 {
word-wrap: break-word;
}

h4 a {
color: #cccccc !important;
}
p {
line-height: 1.5em;
}
img {
max-width: 100%;
}
a img {
vertical-align: bottom;
}
pre, code {
color: #000000;
background-color: #cccccc;
font-family: Monaco, Consolas, "Lucida Console", monospace;
font-size: 12px;
}
pre {
margin: 1em 2em;
padding: 1em;
border-radius: 5px;
overflow: auto;
}
code {
padding: 1px;
}
pre a, code a {
color: #006400 !important;
}
.common {
width: 100%;
margin: 0 auto;
color: #cccccc;
}
.common a {

color: #7fc07f;
text-decoration: none;
}
.common hr {
border-color: #808080;
}
.common a:hover {
text-decoration: underline;
}
.common, .machine {
font-family: "Helvetica Neue", Helvetica, Arial, Geneva, sans-serif;
font-size: 15px;
}
.machine {
margin: 15px;
overflow: hidden;
}
.c1pjs {
overflow: visible;
}
.machine-placeholder {
text-align: center;
font-weight: bold;
}
.common-top {
background: #202020;
font-size: small;
}
.common-top-left {
float: left;
width: 60%;
}
.common-top-left ul {
line-height: 1.5em;
list-style-type: none;
margin: 0;
padding: 1em 1em 1em 9px;
overflow: hidden;
}
.common-top-left ul li {
display: block;
float: left;
}
.common-top-left ul li a {
border-right: 1px solid #6f6f6f;
padding: 2px 6px 2px 6px;
}
.common-top-left ul li:last-child a {
border-right: none;
}
.common-top-right {
float: right;
width: 40%;
}
.common-top-right p {
float: right;
margin: 0;
padding: 1em;
}
.common-middle {
clear: both;
padding: 1px 1em 1px 1em;
background: #404040;
}
.common-sidebar {
float: left;
font-size: small;
width: 140px;
padding-bottom: 20px;
overflow: hidden;
white-space: nowrap;
word-wrap: break-word;
}
.common-list {
list-style-type: none;
margin-top: 0;
margin-bottom: 0;
padding-left: 0;
}
.common-list li {

padding-bottom: 7px;
}
.common-list-data {
list-style-type: none;
margin-top: 0;
margin-bottom: 0;
padding-left: 0;
}
.common-list-data li {
line-height: 1.5em;
}
.common-list-data-items, .common-list-data-subitems {
font-size: x-small;
list-style-type: none;
margin-top: 0;
margin-bottom: 0;
padding-left: 2em;
}
.common-list-data-items li, .common-list-data-subitems li {
padding-bottom: 0;
}
.common-main {
margin-left: 150px;

}
.common-main blockquote {
text-align: justify;
}
.common-image-gallery {
margin: 0 auto;
text-align: center;
}
.common-image-gallery:after {
content: '';
display: block;
}
.common-image-frame {
display: inline-block;
margin: 8px;
text-align: center;
}
.common-image-link {
padding: 5px;
border: 1px solid black;
border-radius: 5px;
background-color: #FAEBD7;
}
.common-image-label {
font-size: x-small;
}
.common-bottom {
clear: both;
padding-top: 1em;
}
.common-bottom:after {
content: '';
display: block;
clear: both;
}
.common-reference {
float: left;
font-size: x-small;
}
.common-reference a {
text-decoration: none;
}
.common-copyright {
float: right;
font-size: x-small;
}
.common-copyright a {
text-decoration: none;
}
.md-list {
}
.md-list li {
line-height: 1.5em;
margin-bottom: 1em;
}
.md-list li p {
padding-left: 2em;
}
.md-list-compact {
}
.md-list-compact li {
margin-bottom: 0;
}
.md-list-none {
list-style-type: none;
padding-left: 2em;
}
.md-list-none li {
margin-bottom: 0;
}
@media screen and (max-width: 900px) {

.common-sidebar {
width: 100%;
white-space: normal;
}
.common-list {
padding-left: 0;
}
.common-list-data {
padding-left: 0;
}
.common-sidebar h4, .common-list li, .common-list-data li, .common-list-data-items li {
width: 130px;
float: left;
overflow: hidden;
vertical-align: top;
padding-right: 1em;
margin-top: 0;
}
.common-list-data-subitems {
display: none;
}
.common-main {
clear: both;
margin-left: 0;
padding-left: 0;
padding-right: 0;
}
.md-list-none {
padding-left: 1em;
}
}
56 changes: 56 additions & 0 deletions versions/c1pjs/1.30.4/common.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- author="Jeff Parsons (@jeffpar)" website="http://www.pcjs.org/" created="2012-05-05" modified="2014-02-23" license="http://www.gnu.org/licenses/gpl.html" -->
<!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp "&#160;"> <!ENTITY ne "&#8800;"> <!ENTITY le "&#8804;"> <!ENTITY ge "&#8805;">
<!ENTITY times "&#215;"> <!ENTITY sdot "&#8901;"> <!ENTITY divide "&#247;">
<!ENTITY copy "&#169;"> <!ENTITY Sigma "&#931;"> <!ENTITY sigma "&#963;"> <!ENTITY sum "&#8721;"> <!ENTITY lbrace "&#123;">
]>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="html"/>

<xsl:template name="commonStyles">
<meta charset="utf-8"/>
<link rel="apple-touch-icon" sizes="57x57" href="/versions/icons/current/pc-icon-57.png"/>
<link rel="apple-touch-icon" sizes="72x72" href="/versions/icons/current/pc-icon-72.png"/>
<link rel="apple-touch-icon" sizes="76x76" href="/versions/icons/current/pc-icon-76.png"/>
<link rel="apple-touch-icon" sizes="114x114" href="/versions/icons/current/pc-icon-114.png"/>
<link rel="apple-touch-icon" sizes="120x120" href="/versions/icons/current/pc-icon-120.png"/>
<link rel="apple-touch-icon" sizes="144x144" href="/versions/icons/current/pc-icon-144.png"/>
<link rel="apple-touch-icon" sizes="152x152" href="/versions/icons/current/pc-icon-152.png"/>
<link rel="apple-touch-icon" sizes="180x180" href="/versions/icons/current/pc-icon-180.png"/>
<link rel="apple-touch-icon" sizes="192x192" href="/versions/icons/current/pc-icon-192.png"/>
<link rel="apple-touch-icon" href="/versions/icons/current/apple-touch-icon.png"/>
<link rel="icon" type="image/png" sizes="192x192" href="/versions/icons/current/pc-icon-192.png"/>
<link rel="shortcut icon" type="image/x-icon" href="/versions/icons/current/favicon.ico"/>
<link rel="stylesheet" type="text/css" href="/versions/c1pjs/1.30.4/common.css"/>
</xsl:template>

<xsl:template name="commonTop">
<div class="common-top">
<div class="common-top-left">
<ul>
<li><a href="/">PCjs</a></li>
<li><a href="/devices/">Devices</a></li>
<li><a href="/docs/">Docs</a></li>
<li><a href="/apps/">Software</a></li>
<li><a href="/docs/about/">About</a></li>
</ul>
</div>
<div class="common-top-right">
<p>Powered by <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript">JavaScript</a>, <a href="http://vanilla-js.com/" target="_blank">Vanilla JS</a>, and <a href="http://github.com/jeffpar/pcjs" target="_blank">GitHub</a></p>
</div>
</div>
</xsl:template>

<xsl:template name="commonBottom">
<div class="common-bottom">
<p class="common-reference"></p>
<p class="common-copyright">
<span class="common-copyright"><a href="http://www.pcjs.org/">pcjs.org</a> © 2012-2016 by <a href="http://twitter.com/jeffpar">@jeffpar</a></span><br/>
<span class="common-copyright"><a href="http://github.com/jeffpar/pcjs">PCjs</a> machines released under <a href="http://gnu.org/licenses/gpl.html">GPLv3</a></span>
</p>
</div>
</xsl:template>

</xsl:stylesheet>
Loading

0 comments on commit a47c88f

Please sign in to comment.