Go to file
R. Eric Wheeler 95c5b66fdc Added strrev function to getch.c 2021-01-25 06:58:35 -08:00
src/Console Added strrev function to getch.c 2021-01-25 06:58:35 -08:00
.gitignore Initial commit 2020-12-22 14:19:32 -08:00
.php_cs.dist Initial commit 2020-12-22 14:19:32 -08:00
LICENSE Initial commit 2020-12-22 14:19:32 -08:00
README.md added _ungetch 2021-01-07 13:56:08 -08:00
composer.json Initial commit 2020-12-22 14:19:32 -08:00
composer.lock Initial commit 2020-12-22 14:19:32 -08:00
header.txt Initial commit 2020-12-22 14:19:32 -08:00

README.md

getch

This simply uses the FFI extension to enable _getwch in Windows and an implimentation of _getwch on linux.

$ composer require sikofitt/getch:dev-master
 use Sikofitt\Console\Getch;
 $g = new Getch($linuxLibrary = null); // can also be a library that implements a function called _getch;
                                       // by default uses the bundled Resources/libgetch.so
                                       // on windows uses the built in _getch function.
 $char = $g->getch();
 print $char;

There is also a helper function called getch();

use function Sikofitt\Console\getch;
$char = getch($linuxLibrary = null);
print $char;

Tests

No tests yet. Just written.