Profectus / features/hotkey
features/hotkey ​
This feature represents an action the player can do by performing a hotkey. It will appear in the information modal for easy player reference.
Typically the action should already be performable by pressing a clickable, so that mobile users can perform the action. For this use case, setting up the hotkey should look like this:
ts
const hotkey = createHotkey(() => ({
description: "Clicks some button",
key: "A",
onPress: clickable.onClick!,
enabled: () => isVisible(clickable.visibility ?? true)
}));