Key
Builder of canonical key ids for use with {@see KeyMatcher::matches()}. The PHP analog of pi-tui's `Key` helper. Each method returns a string id in the exact format {@see KeyMatcher::canonicalId()} expects, so callers never have to remember the modifier order or the alias names. Usage: KeyMatcher::matches($raw, Key::ctrl('c')) KeyMatcher::matches($raw, Key::shift('tab')) KeyMatcher::matches($raw, Key::alt('left')) KeyMatcher::matches($raw, Key::ctrlShift('p')) The bare special-key constants (`Key::ENTER`, `Key::ESCAPE`, …) are the same strings pi-tui uses so behavior transfers across ports.
Key::printableCharacter()
public static function printableCharacter(string $key): ?stringThe character this key produces, or null when it is not a printable one.
Parameters
| Name | Type | Description |
|---|---|---|
| $key | string |
Key::ctrl()
public static function ctrl(string $key): stringThe key name for this key held with Control.
Parameters
| Name | Type | Description |
|---|---|---|
| $key | string |
Key::shift()
public static function shift(string $key): stringThe key name for this key held with Shift.
Parameters
| Name | Type | Description |
|---|---|---|
| $key | string |
Key::alt()
public static function alt(string $key): stringThe key name for this key held with Alt.
Parameters
| Name | Type | Description |
|---|---|---|
| $key | string |
Key::meta()
public static function meta(string $key): stringThe key name for this key held with Meta.
Parameters
| Name | Type | Description |
|---|---|---|
| $key | string |
Key::ctrlShift()
public static function ctrlShift(string $key): stringThe key name for this key held with Control and Shift.
Parameters
| Name | Type | Description |
|---|---|---|
| $key | string |
Key::ctrlAlt()
public static function ctrlAlt(string $key): stringThe key name for this key held with Control and Alt.
Parameters
| Name | Type | Description |
|---|---|---|
| $key | string |
Key::shiftAlt()
public static function shiftAlt(string $key): stringThe key name for this key held with Shift and Alt.
Parameters
| Name | Type | Description |
|---|---|---|
| $key | string |