Commit 17894466 authored by Max Kearney's avatar Max Kearney
Browse files

added more punctuation

parent c7255d1f
......@@ -358,13 +358,16 @@ window.addEventListener("keydown", function (ev) {
add = false;
}
}
if (ev.keyCode === 57 && ev.shiftKey) newChar = "("; // left parenthesis
if (ev.keyCode === 48 && ev.shiftKey) newChar = ")"; // right parenthesis
if (ev.keyCode === 49 && ev.shiftKey) newChar = "!"; // exclamation mark
if (add) {
currentInput = currentInput + newChar;
if (currentInput.length > 120) {
currentInput = currentInput.substring(0, 120);
}
}
} else if ((ev.keyCode >= 189 && ev.keyCode <= 191) || ev.keyCode === 186 || ev.keyCode === 59 || ev.keyCode === 173) { // quick and dirty punctuation
} else if ((ev.keyCode >= 188 && ev.keyCode <= 191) || ev.keyCode === 186 || ev.keyCode === 59 || ev.keyCode === 173 || ev.keyCode === 222) { // quick and dirty punctuation
let newChar = "";
if (ev.keyCode === 186 || (ev.keyCode === 59 && ev.shiftKey)) newChar = ":"; // colon
......@@ -378,6 +381,9 @@ window.addEventListener("keydown", function (ev) {
}
if (ev.keyCode === 190) newChar = "."; // period
if (ev.keyCode === 191) newChar = "/"; // forward slash
if (ev.keyCode === 191 && ev.shiftKey) newChar = "?"; // question mark
if (ev.keyCode === 222) newChar = "'"; // apostrophe
if (ev.keyCode === 188) newChar = ","; // comma
currentInput = currentInput + newChar;
if (currentInput.length > 120) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment