2021-01-31 02:43:13 +13:00
|
|
|
<template>
|
|
|
|
<div id="q-app">
|
|
|
|
<router-view />
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import BaseClass from "src/BaseClass"
|
|
|
|
import { Component } from "vue-property-decorator"
|
2021-02-23 11:30:18 +13:00
|
|
|
import { defaultKeybinds } from "src/appSettings/defaultKeybinds"
|
2021-01-31 02:43:13 +13:00
|
|
|
@Component
|
|
|
|
export default class App extends BaseClass {
|
2021-02-23 11:30:18 +13:00
|
|
|
created () {
|
|
|
|
window.addEventListener("auxclick", this.reactToMiddleClick)
|
|
|
|
|
|
|
|
document.body.onmousedown = function (e) {
|
|
|
|
if (e.button === 1) {
|
|
|
|
e.preventDefault()
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
this.registerDefaultKeybinds()
|
|
|
|
}
|
|
|
|
|
|
|
|
destroyed () {
|
|
|
|
window.removeEventListener("auxclick", this.reactToMiddleClick)
|
|
|
|
|
|
|
|
this.deregisterDefaultKeybinds()
|
|
|
|
}
|
|
|
|
|
|
|
|
reactToMiddleClick (e: {button: number, preventDefault: ()=> void}) {
|
|
|
|
if (e.button === 1) {
|
|
|
|
e.preventDefault()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
registerDefaultKeybinds () {
|
|
|
|
defaultKeybinds.forEach(e => this.SSET_registerDefaultKeybind(e))
|
|
|
|
}
|
2021-01-31 02:43:13 +13:00
|
|
|
|
2021-02-23 11:30:18 +13:00
|
|
|
deregisterDefaultKeybinds () {
|
|
|
|
defaultKeybinds.forEach(e => this.SSET_deregisterDefaultKeybind(e))
|
|
|
|
}
|
2021-01-31 02:43:13 +13:00
|
|
|
}
|
|
|
|
</script>
|