conjure-os/frontend/src/utils/key-contexts/carousel-key-context.ts
2025-06-28 21:05:42 -04:00

39 lines
845 B
TypeScript

import { KeyContext } from "./key-context";
import { KeyboardManager } from "../keyboard-manager";
export class CarouselKeyContext extends KeyContext {
readonly name: string = "CarouselContext";
protected onKeyUp() {
super.onKeyUp();
this.store.moveTagUp();
}
protected onKeyDown() {
super.onKeyDown();
this.store.moveTagDown();
}
protected onKeyRight() {
super.onKeyRight();
this.store.moveGameRight();
}
protected onKeyLeft() {
super.onKeyLeft();
if (this.store.selectedGameIndex === 0) {
KeyboardManager.switchContext("sidebar");
}
else {
this.store.moveGameLeft();
}
}
protected onEscape() {
super.onEscape();
}
protected onEnter() {
super.onEnter();
}
}