From 1d00aafe655c5cc368610f5047433c06f4b82942 Mon Sep 17 00:00:00 2001 From: img2tab <31696646+img2tab@users.noreply.github.com> Date: Thu, 3 Jan 2019 08:40:59 +0000 Subject: [PATCH] added clearinputbuffer function without ever calling it --- macos_okiomov.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/macos_okiomov.sh b/macos_okiomov.sh index 0972149..bdcf6e2 100644 --- a/macos_okiomov.sh +++ b/macos_okiomov.sh @@ -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++ ));