Skip to content

Commit

Permalink
feat: added debugKey (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
amyspark-ng authored May 26, 2024
1 parent be413a2 commit 85ed508
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/kaboom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4883,7 +4883,7 @@ export default (gopt: KaboomOpt = {}): KaboomCtx => {
});

if (gopt.debug !== false) {
app.onKeyPress("f1", () => debug.inspect = !debug.inspect);
app.onKeyPress(gopt.debugKey ?? "f1", () => debug.inspect = !debug.inspect);
app.onKeyPress("f2", () => debug.clearLog());
app.onKeyPress("f8", () => debug.paused = !debug.paused);
app.onKeyPress("f7", () => {
Expand Down
4 changes: 4 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3260,6 +3260,10 @@ export interface KaboomOpt<T extends PluginList<any> = any> {
* If register debug buttons (default true)
*/
debug?: boolean;
/**
* key that toggles debug mode
*/
debugKey?: Key;
/**
* Default font (defaults to "monospace").
*/
Expand Down

0 comments on commit 85ed508

Please sign in to comment.