1.9.3 • Published 2 years ago
az-keyboard-man-vue v1.9.3
Az-keyboard-man-vue
A simple keyboard event listener for Vue
Usage
Modifiers
ctrl/shift/meta/alt
import AzKeyboardMan from 'az-keyboard-man-vue'
Vue.use(AzKeyboardMan)
export default {
created() {
this.$onKeydown(this.handleKeydown, 'KEY_F1') // use with keyName, you can find all keyNames in /src/keyCode.js
this.$onKeydown(this.handleKeydown, 112, {}, 1, 2) // use with keyCode and two parameters are passed to the function
this.$onKeydown(this.handleKeydown, 'KEY_F2', {
modifiers: 'ctrl', // ['ctrl','shift','meta','alt'], default:''
delay: 1000, // default:500
delayType: 'debounce', // ['throttle','debounce',null], default:'throttle'
immediate: false, // default:true
// el: this.$el // A html element
})
this.$onKeyup(this.handleKeyup, 'KEY_F1')
this.$onKeyup(this.handleKeyup, 112)
this.$onKeyup(this.handleKeyup, 'KEY_F2', {
modifiers: 'ctrl,shift',
})
var i = this.$onKeyup(this.handleKeyup, 'KEY_F2')
this.$onKeyRemove(i) // remove this listener
},
methods: {
handleKeydown(e, a, b) {
console.log('down')
console.log(e, a, b)
},
handleKeyup(e) {
console.log('up')
console.log(e)
},
},
}
Installation
npm install az-keyboard-man-vue
or
yarn add az-keyboard-man-vue
1.9.3
2 years ago
1.8.2
2 years ago
1.9.0
2 years ago
1.8.1
2 years ago
1.8.0
2 years ago
1.8.20
2 years ago
1.8.21
2 years ago
1.8.9
2 years ago
1.8.10
2 years ago
1.8.8
2 years ago
1.8.11
2 years ago
1.8.7
2 years ago
1.8.12
2 years ago
1.8.6
2 years ago
1.8.13
2 years ago
1.8.5
2 years ago
1.8.14
2 years ago
1.9.2
2 years ago
1.8.15
2 years ago
1.8.3
2 years ago
1.8.16
2 years ago
1.8.17
2 years ago
1.8.18
2 years ago
1.8.19
2 years ago
1.7.3
2 years ago
1.7.2
2 years ago
1.7.1
2 years ago
1.7.0
2 years ago
1.7.4
2 years ago
1.6.17
2 years ago
1.6.14
2 years ago
1.6.11
2 years ago
1.6.10
2 years ago
1.6.1
2 years ago
1.6.0
2 years ago
1.5.13
2 years ago
1.5.9
3 years ago
1.5.7
3 years ago
1.5.6
3 years ago
1.5.5
3 years ago
1.5.0
3 years ago
1.4.6
3 years ago
1.4.5
3 years ago
1.4.4
3 years ago
1.4.3
3 years ago
1.4.2
3 years ago
1.4.1
3 years ago