Skip to content

Commit

Permalink
Merge pull request #10 from Lynesth/patch-3
Browse files Browse the repository at this point in the history
Add ESC to default controls
  • Loading branch information
AydinHassan committed Apr 2, 2019
2 parents 5533b17 + 2c27f12 commit 2a0e498
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/InputCharacter.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class InputCharacter
public const CTRLW = 'CTRLW';
public const ENTER = 'ENTER';
public const TAB = 'TAB';
public const ESC = 'ESC';

private static $controls = [
"\033[A" => self::UP,
Expand All @@ -41,6 +42,7 @@ class InputCharacter
"\027" => self::CTRLW,
"\n" => self::ENTER,
"\t" => self::TAB,
"\e" => self::ESC,
];

public function __construct(string $data)
Expand Down
1 change: 1 addition & 0 deletions test/InputCharacterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public function testGetControls() : void
'CTRLW',
'ENTER',
'TAB',
'ESC',
],
InputCharacter::getControls()
);
Expand Down

0 comments on commit 2a0e498

Please sign in to comment.