kodadot/nft-gallery

View on GitHub
utils/shortcuts.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { useMagicKeys } from '@vueuse/core'

export function onPressControlEnter(callback: () => void) {
  const { Meta, Control, Enter } = useMagicKeys()

  return watch([Meta, Control, Enter], () => {
    if ((Meta.value || Control.value) && Enter.value) {
      callback()
    }
  })
}