Files
breadcrumb-the-shire/lib/Service/Ui/HotkeyService.php
2026-03-04 15:56:58 +01:00

71 lines
1.7 KiB
PHP

<?php
namespace MintyPHP\Service\Ui;
class HotkeyService
{
/**
* Canonical hotkey list used by UI pages and search.
*
* @return array<int, array{action_key: string, mac: string, win: string}>
*/
public static function list(): array
{
return [
[
'action_key' => 'Open search',
'mac' => 'Cmd + K',
'win' => 'Ctrl + K',
],
[
'action_key' => 'Save in edit pages',
'mac' => 'Cmd + S',
'win' => 'Ctrl + S',
],
[
'action_key' => 'Toggle sidebar',
'mac' => 'Cmd + B',
'win' => 'Ctrl + B',
],
[
'action_key' => 'Switch sidebar section',
'mac' => 'Cmd + 1 ... 0',
'win' => 'Ctrl + 1 ... 0',
],
[
'action_key' => 'Back',
'mac' => 'Alt + Left',
'win' => 'Alt + Left',
],
[
'action_key' => 'Forward',
'mac' => 'Alt + Right',
'win' => 'Alt + Right',
],
];
}
/**
* Keywords that should trigger hotkey search results.
*
* @return string[]
*/
public static function searchKeywords(): array
{
return [
'shortcut',
'shortcuts',
'hotkey',
'hotkeys',
'keyboard',
'key',
'ctrl',
'cmd',
'command',
'tastenkurzel',
'tastenkuerzel',
'taste',
];
}
}