xeokit-sdk
xeokit-sdk copied to clipboard
Incorrect types for CameraControl keyMap
Describe the bug The TS types for keymap on CameraControl only support numbers, but actually the controls support way more options. As a dev this is confusing, because I first thought you could only map a single button to an action with xeokit, but you can actually assign an array and assign as many as you want to.
Current types:
set keyMap(arg: {
[key: number]: number;
});
get keyMap(): {
[key: number]: number;
};
Correct type would be:
type KeyMap = Record<number, string, number[], number[][]>
set keyMap(arg: KeyMap);
get keyMap(): KeyMap;
- number -> single button
- number[] -> multiple buttons which active the action alone
- number[][] -> combination of multiple buttons which need to be pressed at the same time
- string -> preset