Added more VT100 soft keys
This commit is contained in:
parent
e5a8deb054
commit
f486734d19
7 changed files with 65 additions and 26 deletions
|
|
@ -26,11 +26,14 @@
|
|||
</video>
|
||||
<chipset id="chipset" model="VT100"/>
|
||||
<keyboard id="keyboard" model="VT100">
|
||||
<control type="button" binding="setup" padLeft="8px">SET-UP</control>
|
||||
<control type="button" binding="break" padLeft="8px" padBottom="8px">BREAK</control>
|
||||
<control type="button" binding="ctrl" padLeft="8px" padBottom="8px">CTRL</control>
|
||||
<control type="button" binding="esc" padLeft="8px" padBottom="8px">ESC</control>
|
||||
<control type="button" binding="tab" padLeft="8px" padBottom="8px">TAB</control>
|
||||
<control type="button" binding="line-feed" padLeft="8px" padBottom="8px">LINE FEED</control>
|
||||
<control type="button" binding="setup" padLeft="8px" padBottom="8px">SET-UP</control>
|
||||
</keyboard>
|
||||
<serial id="serialPort" adapter="0" binding="print">
|
||||
<control type="button" binding="test" value="HELLO WORLD!\n\\e[D\\e[D\\e[D\\e[D\\e[D\\e[D\\e[D\\e[D\\e[D\\e[D\\e[D" padLeft="8px">TEST RECEIVER</control>
|
||||
</serial>
|
||||
<serial id="serialPort" adapter="0" binding="print"/>
|
||||
<panel ref="/devices/pc8080/panel/wide.xml"/>
|
||||
<debugger id="debugger" messages="mem|port" commands="s 8086"/>
|
||||
</machine>
|
||||
|
|
|
|||
|
|
@ -26,11 +26,14 @@
|
|||
</video>
|
||||
<chipset id="chipset" model="VT100"/>
|
||||
<keyboard id="keyboard" model="VT100">
|
||||
<control type="button" binding="setup" padLeft="8px">SET-UP</control>
|
||||
<control type="button" binding="break" padLeft="8px" padBottom="8px">BREAK</control>
|
||||
<control type="button" binding="ctrl" padLeft="8px" padBottom="8px">CTRL</control>
|
||||
<control type="button" binding="esc" padLeft="8px" padBottom="8px">ESC</control>
|
||||
<control type="button" binding="tab" padLeft="8px" padBottom="8px">TAB</control>
|
||||
<control type="button" binding="line-feed" padLeft="8px" padBottom="8px">LINE FEED</control>
|
||||
<control type="button" binding="setup" padLeft="8px" padBottom="8px">SET-UP</control>
|
||||
</keyboard>
|
||||
<serial id="serialPort" adapter="0" binding="print">
|
||||
<control type="button" binding="test" value="HELLO WORLD!\n\\e[D\\e[D\\e[D\\e[D\\e[D\\e[D\\e[D\\e[D\\e[D\\e[D\\e[D" padLeft="8px">TEST RECEIVER</control>
|
||||
</serial>
|
||||
<serial id="serialPort" adapter="0" binding="print"/>
|
||||
<panel ref="/devices/pc8080/panel/wide.xml"/>
|
||||
<debugger id="debugger" messages="mem|port" commands="s 8086"/>
|
||||
</machine>
|
||||
|
|
|
|||
|
|
@ -26,10 +26,15 @@
|
|||
</video>
|
||||
<chipset id="chipset" model="VT100"/>
|
||||
<keyboard id="keyboard" model="VT100">
|
||||
<control type="button" binding="setup" padLeft="8px">SET-UP</control>
|
||||
<control type="button" binding="break" padLeft="8px" padBottom="8px">BREAK</control>
|
||||
<control type="button" binding="ctrl" padLeft="8px" padBottom="8px">CTRL</control>
|
||||
<control type="button" binding="esc" padLeft="8px" padBottom="8px">ESC</control>
|
||||
<control type="button" binding="tab" padLeft="8px" padBottom="8px">TAB</control>
|
||||
<control type="button" binding="line-feed" padLeft="8px" padBottom="8px">LINE FEED</control>
|
||||
<control type="button" binding="setup" padLeft="8px" padBottom="8px">SET-UP</control>
|
||||
</keyboard>
|
||||
<serial id="serialPort" adapter="0" binding="print">
|
||||
<control type="button" binding="test" value="HELLO WORLD!\n\\e[D\\e[D\\e[D\\e[D\\e[D\\e[D\\e[D\\e[D\\e[D\\e[D\\e[D" padLeft="8px">TEST RECEIVER</control>
|
||||
<control type="button" binding="test" value="HELLO WORLD!\n\\e[D\\e[D\\e[D\\e[D\\e[D\\e[D\\e[D\\e[D\\e[D\\e[D\\e[D" padLeft="8px" padBottom="8px">TEST RECEIVER</control>
|
||||
</serial>
|
||||
<panel ref="/devices/pc8080/panel/wide.xml"/>
|
||||
<debugger id="debugger" messages="mem|port" commands="s 8086"/>
|
||||
|
|
|
|||
|
|
@ -24,11 +24,16 @@
|
|||
</menu>
|
||||
</video>
|
||||
<chipset id="chipset" model="VT100"/>
|
||||
<cpu id="cpu8080" model="8080" cycles="2764800">
|
||||
<control type="button" binding="reset" padLeft="8px" padBottom="8px">RESET</control>
|
||||
</cpu>
|
||||
<keyboard id="keyboard" model="VT100">
|
||||
<control type="button" binding="break" padLeft="8px" padBottom="8px">BREAK</control>
|
||||
<control type="button" binding="ctrl" padLeft="8px" padBottom="8px">CTRL</control>
|
||||
<control type="button" binding="esc" padLeft="8px" padBottom="8px">ESC</control>
|
||||
<control type="button" binding="tab" padLeft="8px" padBottom="8px">TAB</control>
|
||||
<control type="button" binding="line-feed" padLeft="8px" padBottom="8px">LINE FEED</control>
|
||||
<control type="button" binding="setup" padLeft="8px" padBottom="8px">SET-UP</control>
|
||||
</keyboard>
|
||||
<cpu id="cpu8080" model="8080" cycles="2764800">
|
||||
<control type="button" binding="reset">RESET</control>
|
||||
</cpu>
|
||||
<serial id="serialPort" adapter="0"/>
|
||||
</machine>
|
||||
|
|
|
|||
|
|
@ -24,11 +24,16 @@
|
|||
</menu>
|
||||
</video>
|
||||
<chipset id="chipset" model="VT100"/>
|
||||
<keyboard id="keyboard" model="VT100">
|
||||
<control type="button" binding="setup" padLeft="8px" padBottom="8px">SET-UP</control>
|
||||
</keyboard>
|
||||
<cpu id="cpu8080" model="8080" cycles="2764800">
|
||||
<control type="button" binding="reset">RESET</control>
|
||||
</cpu>
|
||||
<keyboard id="keyboard" model="VT100">
|
||||
<control type="button" binding="break" padLeft="8px" padBottom="8px">BREAK</control>
|
||||
<control type="button" binding="ctrl" padLeft="8px" padBottom="8px">CTRL</control>
|
||||
<control type="button" binding="esc" padLeft="8px" padBottom="8px">ESC</control>
|
||||
<control type="button" binding="tab" padLeft="8px" padBottom="8px">TAB</control>
|
||||
<control type="button" binding="line-feed" padLeft="8px" padBottom="8px">LINE FEED</control>
|
||||
<control type="button" binding="setup" padLeft="8px" padBottom="8px">SET-UP</control>
|
||||
</keyboard>
|
||||
<serial id="serialPort" adapter="0"/>
|
||||
</machine>
|
||||
|
|
|
|||
|
|
@ -24,11 +24,18 @@
|
|||
</menu>
|
||||
</video>
|
||||
<chipset id="chipset" model="VT100"/>
|
||||
<cpu id="cpu8080" model="8080" cycles="2764800">
|
||||
<control type="button" binding="reset" padLeft="8px" padBottom="8px">RESET</control>
|
||||
</cpu>
|
||||
<keyboard id="keyboard" model="VT100">
|
||||
<control type="button" binding="break" padLeft="8px" padBottom="8px">BREAK</control>
|
||||
<control type="button" binding="ctrl" padLeft="8px" padBottom="8px">CTRL</control>
|
||||
<control type="button" binding="esc" padLeft="8px" padBottom="8px">ESC</control>
|
||||
<control type="button" binding="tab" padLeft="8px" padBottom="8px">TAB</control>
|
||||
<control type="button" binding="line-feed" padLeft="8px" padBottom="8px">LINE FEED</control>
|
||||
<control type="button" binding="setup" padLeft="8px" padBottom="8px">SET-UP</control>
|
||||
</keyboard>
|
||||
<cpu id="cpu8080" model="8080" cycles="2764800">
|
||||
<control type="button" binding="reset">RESET</control>
|
||||
</cpu>
|
||||
<serial id="serialPort" adapter="0"/>
|
||||
<serial id="serialPort" adapter="0">
|
||||
<control type="button" binding="test" value="HELLO WORLD!\r\n" padLeft="8px" padBottom="8px">TEST RECEIVER</control>
|
||||
</serial>
|
||||
</machine>
|
||||
|
|
|
|||
|
|
@ -145,16 +145,24 @@ class Keyboard8080 extends Component {
|
|||
control.onclick = function(kbd, keyCode) {
|
||||
return function onKeyboardBindingDown(event) {
|
||||
/*
|
||||
* iOS Usability Improvement: Calling preventDefault() prevents rapid clicks from
|
||||
* iOS usability improvement: calling preventDefault() prevents rapid clicks from
|
||||
* also being (mis)interpreted as a desire to "zoom" in on the machine.
|
||||
*/
|
||||
if (event.preventDefault) event.preventDefault();
|
||||
kbd.onSoftKeyDown(keyCode, true, true);
|
||||
/*
|
||||
* I'm assuming we only need to give focus back on the "up" event...
|
||||
*
|
||||
* if (kbd.cmp) kbd.cmp.updateFocus();
|
||||
* TODO: Add some additional SOFTCODES configuration info that will tell us which soft
|
||||
* keys (eg, CTRL) should be treated as toggles, instead of hard-coding that knowledge below.
|
||||
*/
|
||||
var fDown = true;
|
||||
var fAutoRelease = (keyCode != Keys.KEYCODE.CTRL);
|
||||
if (!fAutoRelease) {
|
||||
control.style.fontWeight = "normal";
|
||||
fDown = !(kbd.bitsState & Keyboard8080.STATE.CTRL);
|
||||
if (fDown) control.style.fontWeight = "bold";
|
||||
kbd.checkModifierKeys(keyCode, fDown);
|
||||
}
|
||||
kbd.onSoftKeyDown(keyCode, fDown, fAutoRelease);
|
||||
if (kbd.cmp) kbd.cmp.updateFocus();
|
||||
};
|
||||
}(this, this.config.SOFTCODES[sBinding]);
|
||||
//
|
||||
|
|
@ -394,7 +402,7 @@ class Keyboard8080 extends Component {
|
|||
* @this {Keyboard8080}
|
||||
* @param {number} keyCode (ie, either a keycode or string ID)
|
||||
* @param {boolean} fDown (true if key going down, false if key going up)
|
||||
* @param {boolean} fRight (true if key is on the right, false if not or unknown or n/a)
|
||||
* @param {boolean} [fRight] (true if key is on the right, false if not or unknown or n/a)
|
||||
*/
|
||||
checkModifierKeys(keyCode, fDown, fRight)
|
||||
{
|
||||
|
|
@ -1045,6 +1053,9 @@ Keyboard8080.VT100 = {
|
|||
ALTCODES: {},
|
||||
LEDCODES: {},
|
||||
SOFTCODES: {
|
||||
'ctrl': Keys.KEYCODE.CTRL,
|
||||
'esc': Keys.KEYCODE.ESC,
|
||||
'tab': Keys.KEYCODE.TAB,
|
||||
'num-comma': Keys.KEYCODE.F5,// since modern keypads don't typically have a comma...
|
||||
'break': Keys.KEYCODE.F6,
|
||||
'line-feed': Keys.KEYCODE.F7,
|
||||
|
|
|
|||
Loading…
Reference in a new issue