Skip to content

Instantly share code, notes, and snippets.

@letsgoawaydev
Last active December 11, 2022 08:10
Show Gist options
  • Select an option

  • Save letsgoawaydev/21227f8da58cfe024c9329c031b72c7e to your computer and use it in GitHub Desktop.

Select an option

Save letsgoawaydev/21227f8da58cfe024c9329c031b72c7e to your computer and use it in GitHub Desktop.

Revisions

  1. letsgoawaydev revised this gist Dec 11, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion onScreenKeyboard.js
    Original file line number Diff line number Diff line change
    @@ -10,7 +10,7 @@ function onScreenKeyboard() {
    document.body.removeChild(inputBox);
    };
    inputBox.onkeyup = function () {
    inputBoxValue = inputbox.value;
    inputBoxValue = inputBox.value;
    if (evt.keyCode === 13) {
    inputBox.blur();
    }
  2. letsgoawaydev revised this gist Dec 11, 2022. 1 changed file with 16 additions and 3 deletions.
    19 changes: 16 additions & 3 deletions onScreenKeyboard.js
    Original file line number Diff line number Diff line change
    @@ -1,10 +1,23 @@
    let inputBoxValue = "";
    function onScreenKeyboard() {
    let inputBox = document.createElement("input");
    inputBox.id = "inputBox";
    inputBox.style = "opacity: 1; border: none; outline: 0; width:0%; height:0%; position:absolute; top:0px; caret-color: transparent; color: transparent;";
    inputBox.style = "opacity: 1; border: none; outline: 0; width: 0%; height: 0%; position: absolute; top: 0px; caret-color: transparent; color: transparent;";
    inputBox.type = "text";
    document.body.appendChild(inputBox);
    document.getElementById("inputBox").focus();
    inputBox.focus();
    inputBox.onblur = function () {
    document.body.removeChild(inputBox);
    };
    inputBox.onkeyup = function () {
    inputBoxValue = inputbox.value;
    if (evt.keyCode === 13) {
    inputBox.blur();
    }
    }
    inputBox.onchange = function () {
    inputBoxValue = inputBox.value; // We set this so the inputBox.value doesnt become undefined once we remove it
    }
    return inputBox;
    }// You may need to use an async function or requestAnimationFrame or setInterval to
    // get the current value of inputBox.value (the text the user writes)
    // get the current value of inputBoxValue (the text the user writes)
  3. letsgoawaydev revised this gist Dec 11, 2022. 1 changed file with 8 additions and 8 deletions.
    16 changes: 8 additions & 8 deletions onScreenKeyboard.js
    Original file line number Diff line number Diff line change
    @@ -1,10 +1,10 @@
    function onScreenKeyboard() {
    let inputBox = document.createElement("input");
    inputBox.id = "inputBox";
    inputBox.style = "opacity: 1; border: none; outline: 0; width:0%; height:0%; caret-color: transparent; color: transparent;";
    inputBox.type = "text";
    document.body.appendChild(inputBox);
    document.getElementById("inputBox").focus();
    return inputBox;
    } // You may need to use an async function or requestAnimationFrame or setInterval to
    let inputBox = document.createElement("input");
    inputBox.id = "inputBox";
    inputBox.style = "opacity: 1; border: none; outline: 0; width:0%; height:0%; position:absolute; top:0px; caret-color: transparent; color: transparent;";
    inputBox.type = "text";
    document.body.appendChild(inputBox);
    document.getElementById("inputBox").focus();
    return inputBox;
    }// You may need to use an async function or requestAnimationFrame or setInterval to
    // get the current value of inputBox.value (the text the user writes)
  4. letsgoawaydev revised this gist Dec 10, 2022. 1 changed file with 1 addition and 3 deletions.
    4 changes: 1 addition & 3 deletions onScreenKeyboard.js
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,5 @@ function onScreenKeyboard() {
    document.body.appendChild(inputBox);
    document.getElementById("inputBox").focus();
    return inputBox;
    }
    // You may need to use an async function or requestAnimationFrame or setInterval to
    } // You may need to use an async function or requestAnimationFrame or setInterval to
    // get the current value of inputBox.value (the text the user writes)

  5. letsgoawaydev revised this gist Dec 10, 2022. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions onScreenKeyboard.js
    Original file line number Diff line number Diff line change
    @@ -9,3 +9,4 @@ function onScreenKeyboard() {
    }
    // You may need to use an async function or requestAnimationFrame or setInterval to
    // get the current value of inputBox.value (the text the user writes)

  6. letsgoawaydev revised this gist Dec 10, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion onScreenKeyboard.js
    Original file line number Diff line number Diff line change
    @@ -8,4 +8,4 @@ function onScreenKeyboard() {
    return inputBox;
    }
    // You may need to use an async function or requestAnimationFrame or setInterval to
    // get the current value of inputBox.value (the text the user writes)
    // get the current value of inputBox.value (the text the user writes)
  7. letsgoawaydev revised this gist Dec 10, 2022. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion onScreenKeyboard.js
    Original file line number Diff line number Diff line change
    @@ -7,4 +7,5 @@ function onScreenKeyboard() {
    document.getElementById("inputBox").focus();
    return inputBox;
    }
    // You might need to use an async function to get the current value of inputBox.value (the text the user writes)
    // You may need to use an async function or requestAnimationFrame or setInterval to
    // get the current value of inputBox.value (the text the user writes)
  8. letsgoawaydev created this gist Dec 10, 2022.
    10 changes: 10 additions & 0 deletions onScreenKeyboard.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    function onScreenKeyboard() {
    let inputBox = document.createElement("input");
    inputBox.id = "inputBox";
    inputBox.style = "opacity: 1; border: none; outline: 0; width:0%; height:0%; caret-color: transparent; color: transparent;";
    inputBox.type = "text";
    document.body.appendChild(inputBox);
    document.getElementById("inputBox").focus();
    return inputBox;
    }
    // You might need to use an async function to get the current value of inputBox.value (the text the user writes)