genie-hki
read/write hotkey files for Age of Empires II
Install - Usage - License: Apache-2.0
Install
npm install genie-hki
Usage
var genieHki = var hki = genieHkihkiversion // 1.0, 2.0 or 3.0hkigroups // array of arrays of hotkey objects
API
hki = genieHki.load(buffer)
Load hotkeys from a Buffer.
buffer = genieHki.save(hki)
Save hotkeys to a Buffer.
hki.version
Version of the HKI file. 2.0 for recent HD versions, 1.0 otherwise.
hki.groups
Array of hotkey groups.
group = hki.groups[groupId]
Array of hotkeys for a group.
groupId
is one of the genieHki.HotkeyGroups
constants:
hkigroupsHotkeyGroupsVillager// → array of hotkey objects
hotkey = group[hotkeyId]
A hotkey object with properties:
hotkey.key
- vkey ID, you can use thevkey
package to get the associated name (likeC
for id67
)hotkey.stringId
- string ID of the label for this key (eg 6121 for "Create Villager")hotkey.ctrl
- whether Ctrl should be pressed to activate this hotkeyhotkey.shift
- whether Shift should be pressed to activate this hotkeyhotkey.alt
- whether Alt should be pressed to activate this hotkeyhotkey.mouse
- whether this is a mouse hotkey, rather than a keyboard one
Index into the array with the appropriate hotkey constants. For example:
var HotkeyGroups = genieHkiHotkeyGroupsvar TownCenterHotkeys = genieHkiTownCenterHotkeysvar townCenter = hkigroupsHotkeyGroupsTownCentervar createVillager = townCenterTownCenterHotkeysCreateVillager var vkey = console