Improvements to the keyboard.
Add a number pad to the keyboard. Make it hidden by default for RLG-Web.
This commit is contained in:
parent
9ddc3c685c
commit
2ab0de0799
6 changed files with 59 additions and 6 deletions
18
rlgterm.js
18
rlgterm.js
|
|
@ -327,6 +327,10 @@ var charshifts = { '-': "5f", '=': "2b", '[': "7b", ']': "7d", '\\': "7c",
|
|||
';': "3a", '\'': "22", ',': "3c", '.': "3e", '/': "3f", '`': "7e"
|
||||
}
|
||||
|
||||
var kpkeys = { "KP1": "1b4f46", "KP2": "1b4f42", "KP3": "1b5b367e",
|
||||
"KP4": "1b4f44", "KP5": "1b5b45", "KP6": "1b4f43",
|
||||
"KP7": "1b4f48", "KP8": "1b4f41", "KP9": "1b5b357e" };
|
||||
|
||||
function vkey(c) {
|
||||
if (!session.playing)
|
||||
return;
|
||||
|
|
@ -363,6 +367,9 @@ function vkey(c) {
|
|||
else
|
||||
keystr = c.charCodeAt(0).toString(16);
|
||||
}
|
||||
else if (c in kpkeys) {
|
||||
keystr = kpkeys[c];
|
||||
}
|
||||
else
|
||||
return;
|
||||
var datareq = new XMLHttpRequest();
|
||||
|
|
@ -760,11 +767,14 @@ function setmode(mode, ev) {
|
|||
}
|
||||
}
|
||||
|
||||
function toggledebug() {
|
||||
if (document.getElementById("debug").style.display != "block")
|
||||
document.getElementById("debug").style.display = "block";
|
||||
function toggleBlock(id) {
|
||||
var element = document.getElementById(id);
|
||||
if (!element)
|
||||
return;
|
||||
if (element.style.display != "block")
|
||||
element.style.display = "block";
|
||||
else
|
||||
document.getElementById("debug").style.display = "none";
|
||||
element.style.display = "none";
|
||||
}
|
||||
|
||||
function debug(level, msg) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue