Class Shortcuts
Class for manager shortcuts.
See also
Constructor
- Parameters:
Hint
Service
is an enum and can be imported fromooodev.loader.inst.service
Convert from KeyEvent to string shortcut
- Return type:
str
- Parameters:
key_event (KeyEvent) –
Get all events key.
- Returns:
List of tuples with shortcut and command.
- Return type:
List[Tuple[str, str]]
Get shortcuts by command.
- Parameters:
command (str | dict) – Command to search, ‘UNOCOMMAND’ or dict with macro info.
- Returns:
List of shortcuts or empty list of not found.
- Return type:
List[str]
Get command by key event
- Return type:
str
- Parameters:
key_event (KeyEvent) –
Get command by shortcut
- Return type:
str
- Parameters:
shortcut (str) –
Get shortcut for key event.
- Parameters:
key (KeyEvent) – Key event
- Returns:
Shortcut like Shift+Ctrl+Alt+LETTER
- Return type:
str
Get uno command or url for macro.
- Parameters:
command (str | CommandDict) – Command to search, ‘UNOCOMMAND’ or dict with macro info.
- Returns:
Url for macro or uno command or custom command.
- Return type:
str
Note
If
command
is passed in a a string and it starts with.custom:
then it will be returned with the.custom:
prefix dropped.The
.custom:
prefix is used to indicate that the command is a custom command and can be used in a menu callback to capture user clicks.
Remove by shortcut.
- Parameters:
command (str | CommandDict) – Command to remove, ‘UNOCOMMAND’ or dict with macro info.
save (bool, optional) – Save configuration causing it to persist. Defaults to
False
.
Remove by shortcut
- Parameters:
shortcut (str) – Shortcut like Shift+Ctrl+Alt+LETTER
save (bool, optional) – Save configuration causing it to persist. Defaults to
False
.
- Returns:
True
if removed successfully- Return type:
bool
Reset configuration
- Return type:
None
Set shortcut to command
- Parameters:
shortcut (str) – Shortcut like Shift+Ctrl+Alt+LETTER
command (str | CommandDict) – Command to assign, ‘UNOCOMMAND’ or dict with macro info.
save (bool, optional) – Save configuration causing it to persist. Defaults to
True
.
- Returns:
True if set successfully
- Return type:
bool
Convert from string shortcut (Shift+Ctrl+Alt+LETTER) to KeyEvent
- Return type:
KeyEvent | None
- Parameters:
shortcut (str) –
The dictionary Keys are the integer values of the keys and the values are the key names.