Go to file
R. Eric Wheeler 624e659a26 Fix Getch::LINUX_LIBRARY from libgetch.so to libgetwch.so 2020-12-22 14:35:45 -08:00
src/Console Fix Getch::LINUX_LIBRARY from libgetch.so to libgetwch.so 2020-12-22 14:35:45 -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 Initial commit 2020-12-22 14:19:32 -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 _getwch;
                                       // by default uses the bundled Resources/libgetwch.so
                                       // on windows uses the built in _getwch 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.