Skip to content

Commit 2a0e498

Browse files
authored
Merge pull request #10 from Lynesth/patch-3
Add ESC to default controls
2 parents 5533b17 + 2c27f12 commit 2a0e498

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/InputCharacter.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class InputCharacter
2626
public const CTRLW = 'CTRLW';
2727
public const ENTER = 'ENTER';
2828
public const TAB = 'TAB';
29+
public const ESC = 'ESC';
2930

3031
private static $controls = [
3132
"\033[A" => self::UP,
@@ -41,6 +42,7 @@ class InputCharacter
4142
"\027" => self::CTRLW,
4243
"\n" => self::ENTER,
4344
"\t" => self::TAB,
45+
"\e" => self::ESC,
4446
];
4547

4648
public function __construct(string $data)

test/InputCharacterTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ public function testGetControls() : void
5858
'CTRLW',
5959
'ENTER',
6060
'TAB',
61+
'ESC',
6162
],
6263
InputCharacter::getControls()
6364
);

0 commit comments

Comments
 (0)