konrad
feea191ecf
All checks were successful
continuous-integration/drone/push Build is passing
Co-authored-by: kolaente <k@knt.li> Reviewed-on: #942 Reviewed-by: dpschen <dpschen@noreply.kolaente.de> Co-authored-by: konrad <k@knt.li> Co-committed-by: konrad <k@knt.li>
18 lines
386 B
TypeScript
18 lines
386 B
TypeScript
import {Directive} from 'vue'
|
|
import {install, uninstall} from '@github/hotkey'
|
|
import {isAppleDevice} from '@/helpers/isAppleDevice'
|
|
|
|
const directive: Directive = {
|
|
mounted(el, {value}) {
|
|
if (isAppleDevice() && value.includes('Control')) {
|
|
value = value.replace('Control', 'Meta')
|
|
}
|
|
install(el, value)
|
|
},
|
|
beforeUnmount(el) {
|
|
uninstall(el)
|
|
},
|
|
}
|
|
|
|
export default directive
|