@benev/nubs
Version:
user-input system for web games
16 lines • 617 B
JavaScript
import { KeycapView } from "../views/keycap.js";
export function renderKeycap({ waiting, currentlyWaitingForThisEffect, onClickRebind, }) {
return (code, keyIndex) => KeycapView({
keyIndex,
code: code.length ? code.join(" ") : "-",
isWaiting: (currentlyWaitingForThisEffect &&
(waiting === null || waiting === void 0 ? void 0 : waiting.keyIndex) === keyIndex),
onClickRebind(event) {
if (!waiting) {
event.preventDefault();
onClickRebind(keyIndex);
}
},
});
}
//# sourceMappingURL=render-keycap.js.map