added clearinputbuffer function without ever calling it

This commit is contained in:
img2tab
2019-01-03 08:40:59 +00:00
committed by GitHub
parent d3818c23d9
commit 1d00aafe65
+6 -1
View File
@@ -2,7 +2,7 @@
# One-Key-Installation of macOS on VirtualBox
# (c) img2tab, licensed under GPL2.0 or higher
# url: https://github.com/img2tab/okiomov
# version 0.26
# version 0.27
# Requirements: 33.5GB available storage on host
# Dependencies: bash>4.0, unzip, wget, dmg2img, VirtualBox>5.2
@@ -307,6 +307,11 @@ declare -A ksc=(
["?"]="2A 35 B5 AA"
)
# hacky way to clear input buffer before sending scancodes
function clearinputbuffer() {
while read -d '' -r -t 0; do read -d '' -t 0.1 -n 10000; break; done
}
# read variable kbstring and convert string to scancodes and send to guest vm
function sendkeys() {
scancode=$(for (( i=0; i < ${#kbstring}; i++ ));