php-kilo/src/editor.php

27 lines
318 B
PHP

<?php declare(strict_types=1);
namespace Kilo;
class Editor {
public function __construct()
{
}
public function processKeypress(): void
{
$c = $this->readKey();
switch($c)
{
case chr(ctrl_key('q')):
exit(0);
break;
}
}
protected function readKey(): string
{
return read_stdin(1);
}
}