diff --git a/examples/web/gb.ts b/examples/web/gb.ts index d38d87dbb0c0df4857a70759cf04294ea6a59765..5b0c961e951e21e01e36fba99fba451035a8fb4f 100644 --- a/examples/web/gb.ts +++ b/examples/web/gb.ts @@ -346,7 +346,13 @@ export class GameboyEmulator extends EmulatorBase implements Emulator { } get features(): Feature[] { - return [Feature.Debug, Feature.Palettes, Feature.Benchmark]; + return [ + Feature.Debug, + Feature.Palettes, + Feature.Benchmark, + Feature.Keyboard, + Feature.KeyboardGB + ]; } get romExts(): string[] { diff --git a/examples/web/react/app.tsx b/examples/web/react/app.tsx index bed7224ed93df91f00850be0406d68fae448ef6e..4f02e1603c080b229e760b035fa54e47666b7b93 100644 --- a/examples/web/react/app.tsx +++ b/examples/web/react/app.tsx @@ -15,6 +15,7 @@ import { DrawHandler, Footer, Info, + KeyboardChip8, KeyboardGB, Link, Modal, @@ -80,7 +81,10 @@ export type BenchmarkResult = { export enum Feature { Debug = 1, Palettes, - Benchmark + Benchmark, + Keyboard, + KeyboardChip8, + KeyboardGB } export interface ObservableI { @@ -591,11 +595,19 @@ export const App: FC<AppProps> = ({ } > <Section visible={keyboardVisible} separatorBottom={true}> - <KeyboardGB - fullscreen={fullscreenState} - onKeyDown={onKeyDown} - onKeyUp={onKeyUp} - /> + {hasFeature(Feature.KeyboardChip8) && ( + <KeyboardChip8 + onKeyDown={onKeyDown} + onKeyUp={onKeyUp} + /> + )} + {hasFeature(Feature.KeyboardGB) && ( + <KeyboardGB + fullscreen={fullscreenState} + onKeyDown={onKeyDown} + onKeyUp={onKeyUp} + /> + )} </Section> <Title text={emulator.name} @@ -774,14 +786,16 @@ export const App: FC<AppProps> = ({ style={["simple", "border", "padded"]} onClick={onFullscreenClick} /> - <Button - text={"Keyboard"} - image={require("../res/dialpad.svg")} - imageAlt="keyboard" - enabled={keyboardVisible} - style={["simple", "border", "padded"]} - onClick={onKeyboardClick} - /> + {hasFeature(Feature.Keyboard) && ( + <Button + text={"Keyboard"} + image={require("../res/dialpad.svg")} + imageAlt="keyboard" + enabled={keyboardVisible} + style={["simple", "border", "padded"]} + onClick={onKeyboardClick} + /> + )} <Button text={"Information"} image={require("../res/info.svg")}