From 47a4525b6095dc8751510055b55ec2d12e878d09 Mon Sep 17 00:00:00 2001 From: "R. Eric Wheeler" Date: Thu, 7 Jan 2021 13:58:46 -0800 Subject: [PATCH] added helper function ungetch --- src/Console/function.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Console/function.php b/src/Console/function.php index 52a5747..35f68b4 100644 --- a/src/Console/function.php +++ b/src/Console/function.php @@ -19,3 +19,12 @@ if (!function_exists('getch')) { return $g->getch(); } } + +if(!function_exists('ungetch')) { + + function ungetch(string $char, string $linuxLibrary = null): int + { + $g = new Getch($linuxLibrary); + return $g->ungetch($char); + } +}