bsergent / overmorrow

Typescript canvas game engine
http://challengercity.com/v4/projects/overmorrow/
0 stars 1 forks source link

Add keymap support to Controller #53

Open bsergent opened 5 years ago

bsergent commented 5 years ago

Allow adding and use of keymaps. All listeners will have their keys set to labels so that the physical keys may be abstracted away. Necessary for allowing users to remap keys. Should multiple keys be allowed to map to a single label? Probably, so will need to maybe do this backwards where keys are mapped to labels, not labels mapped to keys. Actually, that would allow for faster lookups anyways. Yeah, so have a hashmap w/ entries of map[key]='label'.

Controller.mapKey(key: Keys, label: string); Controller.clearKey(key: Keys); // or just Controller.mapKey(key: Keys, null);