# v-hotkey **Repository Path**: mirrors_dafrok/v-hotkey ## Basic Information - **Project Name**: v-hotkey - **Description**: Vue 2.x directive for binding hotkeys to components. - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-08 - **Last Updated**: 2026-05-23 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # v-hotkey [![bundlephobia minified size](https://badgen.net/bundlephobia/min/v-hotkey)](https://bundlephobia.com/result?p=v-hotkey) [![npm package version](https://badgen.net/npm/v/v-hotkey)](https://npm.im/v-hotkey) [![github license](https://badgen.net/github/license/dafrok/v-hotkey)](https://github.com/dafrok/v-hotkey/blob/master/LICENSE) [![js standard style](https://badgen.net/badge/code%20style/standard/pink)](https://standardjs.com) Vue 2.x directive for binding hotkeys to components. ## Play with me [https://dafrok.github.io/v-hotkey](https://dafrok.github.io/v-hotkey) ## Install ```bash $ npm i v-hotkey # or $ yarn add v-hotkey ``` ## Usage ```javascript import Vue from 'vue' import VueHotkey from 'v-hotkey' Vue.use(VueHotkey) ``` ```vue ``` ## Event Handler - keydown (as default) - keyup ## Key Combination Use one or more of following keys to fire your hotkeys. - ctrl - alt - shift - command (MacOS) - windows (Windows) ## Modifiers ### prevent Add the prevent modifier to the directive to prevent default browser behavior. ```vue ``` ### stop Add the stop modifier to the directive to stop event propagation. ```vue ``` ## Key Code Alias The default key code map is based on US standard keyboard. This ability to provide their own key code alias for developers who using keyboards with different layouts. The alias name must be a **single character**. ### Definition ```javascript import Vue from 'vue' import VueHotkey from 'v-hotkey' Vue.use(VueHotkey, { '①': 49 // the key code of character '1' }) ``` ### Template ```vue ```