Skip to content

Commit

Permalink
feat: debug log keybindings triggering πŸ”Š
Browse files Browse the repository at this point in the history
  • Loading branch information
kareemmahlees committed Aug 20, 2024
1 parent 40821e7 commit 0dcafd6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion apps/core/src/keybindings/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
KEYBINDINGS_FILE_NAME
} from "@/bindings"
import { BaseDirectory, readTextFile } from "@tauri-apps/plugin-fs"
import { debug } from "@tauri-apps/plugin-log"
import hotkeys from "hotkeys-js"
import { createContext, useContext } from "react"

Expand Down Expand Up @@ -45,7 +46,12 @@ export class KeybindingsManager {
)
if (binding) {
this.registeredKeybindings.push(keybinding)
hotkeys(binding.shortcuts.join(","), keybinding.handler)
hotkeys(binding.shortcuts.join(","), (_, event) => {
debug(
`Keybinding activated: { shortcut: ${event.shortcut}, command: ${keybinding.command} }`
)
keybinding.handler()
})
}
})
}
Expand Down

0 comments on commit 0dcafd6

Please sign in to comment.