Skip to content

Commit d62fb65

Browse files
committed
[#4] Add modifier keys to keyboard shortcuts to avoid interference
1 parent 7d4d3cb commit d62fb65

File tree

2 files changed

+20
-13
lines changed

2 files changed

+20
-13
lines changed

src/components/control/ControlGeneral.vue

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@
4545
Continue
4646
</b-button>
4747
</span>
48-
<div class="btn-group-toggle btn-group">
48+
<div class="btn-group-toggle btn-group" v-hotkey="keymapToggleAutoRef">
4949
<label v-b-tooltip.hover
50-
title="Enable automatic continuation based on game events"
50+
:title="'Enable automatic continuation based on game events (' + Object.keys(keymapToggleAutoRef)[0] + ')'"
5151
:class="{btn:true, 'btn-secondary': true, active: autoContinue}"
5252
@click="setAutoContinue(true)">
5353
Auto
5454
</label>
5555
<label v-b-tooltip.hover
56-
title="Disable automatic continuation based on game events"
56+
:title="'Disable automatic continuation based on game events (' + Object.keys(keymapToggleAutoRef)[0] + ')'"
5757
:class="{btn:true, 'btn-secondary': true, active: !autoContinue}"
5858
@click="setAutoContinue(false)">
5959
Manual
@@ -92,7 +92,7 @@
9292
},
9393
keymapStop() {
9494
return {
95-
'numpad 0': () => {
95+
'ctrl+alt+numpad 0': () => {
9696
if (!this.$refs.btnStop.disabled) {
9797
this.send('stop')
9898
}
@@ -101,7 +101,7 @@
101101
},
102102
keymapForceStart() {
103103
return {
104-
'numpad 5': () => {
104+
'ctrl+alt+numpad 5': () => {
105105
if (!this.$refs.btnForceStart.disabled) {
106106
this.send('forceStart')
107107
}
@@ -110,7 +110,7 @@
110110
},
111111
keymapNormalStart() {
112112
return {
113-
'numpad -': () => {
113+
'ctrl+alt+numpad 8': () => {
114114
if (!this.$refs.btnNormalStart.disabled) {
115115
this.send('normalStart')
116116
}
@@ -119,13 +119,20 @@
119119
},
120120
keymapContinue() {
121121
return {
122-
'numpad +': () => {
122+
'ctrl+alt+space': () => {
123123
if (!this.$refs.btnContinue.disabled) {
124124
this.triggerContinue()
125125
}
126126
}
127127
}
128128
},
129+
keymapToggleAutoRef() {
130+
return {
131+
'ctrl+alt+numpad 2': () => {
132+
this.setAutoContinue(!this.autoContinue)
133+
}
134+
}
135+
},
129136
state() {
130137
return this.$store.state.refBoxState
131138
},

src/components/control/ControlTeam.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,23 +90,23 @@
9090
},
9191
keymapKickoff() {
9292
if (this.teamColor === 'Yellow') {
93-
return {'numpad 1': this.sendKickoff};
93+
return {'ctrl+alt+numpad 1': this.sendKickoff};
9494
} else if (this.teamColor === 'Blue') {
95-
return {'numpad 3': this.sendKickoff};
95+
return {'ctrl+alt+numpad 3': this.sendKickoff};
9696
}
9797
},
9898
keymapDirect() {
9999
if (this.teamColor === 'Yellow') {
100-
return {'numpad 7': this.sendDirect};
100+
return {'ctrl+alt+numpad 7': this.sendDirect};
101101
} else if (this.teamColor === 'Blue') {
102-
return {'numpad 9': this.sendDirect};
102+
return {'ctrl+alt+numpad 9': this.sendDirect};
103103
}
104104
},
105105
keymapIndirect() {
106106
if (this.teamColor === 'Yellow') {
107-
return {'numpad 4': this.sendIndirect};
107+
return {'ctrl+alt+numpad 4': this.sendIndirect};
108108
} else if (this.teamColor === 'Blue') {
109-
return {'numpad 6': this.sendIndirect};
109+
return {'ctrl+alt+numpad 6': this.sendIndirect};
110110
}
111111
},
112112
state() {

0 commit comments

Comments
 (0)