php-kilo/src/Enum/KeyType.php

36 lines
933 B
PHP
Raw Normal View History

2019-10-24 16:57:27 -04:00
<?php declare(strict_types=1);
2019-11-08 16:27:08 -05:00
namespace Aviat\Kilo\Enum;
2019-10-24 16:57:27 -04:00
2019-11-19 15:57:51 -05:00
use Aviat\Kilo\Traits;
2021-12-03 11:45:40 -05:00
use JsonSerializable;
2019-11-19 15:57:51 -05:00
2020-02-05 14:50:31 -05:00
/**
2021-12-03 11:45:40 -05:00
* Enum representing various control keys
2020-02-05 14:50:31 -05:00
*/
2021-12-03 11:45:40 -05:00
enum KeyType implements JsonSerializable {
use Traits\EnumTrait;
2023-10-10 15:21:24 -04:00
use Traits\ConstList;
2019-11-19 13:48:12 -05:00
2023-10-10 15:21:24 -04:00
// ------------------------------------------------------------------------
// Movement Keys
// ------------------------------------------------------------------------
case ArrowUp;
2021-12-03 11:45:40 -05:00
case ArrowDown;
case ArrowLeft;
case ArrowRight;
2023-10-10 15:21:24 -04:00
case Home;
case End;
case PageUp;
case PageDown;
// ------------------------------------------------------------------------
// Editing Keys
// ------------------------------------------------------------------------
2021-12-03 11:45:40 -05:00
case Backspace;
case Delete;
case Enter;
2023-10-10 15:21:24 -04:00
// ------------------------------------------------------------------------
// Others
// ------------------------------------------------------------------------
2021-12-03 11:45:40 -05:00
case Escape;
2019-10-24 16:57:27 -04:00
}