@dank-inc/sketchy
Version:
A Super-dank sketching library built with ♥ and typescript!
17 lines (16 loc) • 485 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.createControls = void 0;
var createControls = function (handlers) {
var state = [];
var handleKeyDown = function (e) {
var _a;
(_a = handlers[e.code]) === null || _a === void 0 ? void 0 : _a.call(handlers);
state.push(e.code);
};
window.addEventListener('keydown', handleKeyDown);
return [
state,
];
};
exports.createControls = createControls;