修复键盘监听导致的输入问题

This commit is contained in:
shefengchun 2023-02-10 09:55:11 +08:00
parent e37999a924
commit b3cc026b41
1 changed files with 36 additions and 32 deletions

View File

@ -59,8 +59,8 @@
<q-btn size="sm" dense color="white" @click="resetall" text-color="black" :label="$t('resetall')" /> <q-btn size="sm" dense color="white" @click="resetall" text-color="black" :label="$t('resetall')" />
</div> </div>
<div class="col-2"> <div class="col-2">
<q-input filled type="number" :dense="true" @focus="isactivearray[3] = false" v-model="four[3].x" <q-input filled type="number" :dense="true" @focus="isactivearray[3] = false" v-model="four[3].x" label="x"
label="x" lazy-rules /> lazy-rules />
<q-input filled type="number" class="q-pt-md" :dense="true" @focus="isactivearray[3] = false" v-model="four[3].y" <q-input filled type="number" class="q-pt-md" :dense="true" @focus="isactivearray[3] = false" v-model="four[3].y"
label="y" lazy-rules /> label="y" lazy-rules />
<q-btn size="sm" dense color="white" @click="reset(3,false)" text-color="black" <q-btn size="sm" dense color="white" @click="reset(3,false)" text-color="black"
@ -200,7 +200,7 @@ export default defineComponent({
}; };
const keyDown = () => { const keyDown = () => {
document.onkeydown = (e) => { document.onkeydown = (e) => {
let lock = 0
let e1 = e || window.event || arguments.callee.caller.arguments[0] let e1 = e || window.event || arguments.callee.caller.arguments[0]
switch (e.code) { switch (e.code) {
case "KeyW": case "KeyW":
@ -220,8 +220,10 @@ export default defineComponent({
points[now_index.value].y points[now_index.value].y
break; break;
default: default:
lock = 1
break; break;
} }
if (lock == 0) {
let tmp = { left: points[now_index.value].x, top: points[now_index.value].y } let tmp = { left: points[now_index.value].x, top: points[now_index.value].y }
eval(`moveHandler_${now_index.value + 1}(tmp)`); eval(`moveHandler_${now_index.value + 1}(tmp)`);
isactivearray.value[now_index.value] = false; isactivearray.value[now_index.value] = false;
@ -230,6 +232,8 @@ export default defineComponent({
isshowarray.value[now_index.value] = true; isshowarray.value[now_index.value] = true;
}, 100); }, 100);
} }
}
} }
onMounted(() => { onMounted(() => {
ste_status.value = 1; ste_status.value = 1;
@ -316,6 +320,7 @@ export default defineComponent({
let y = Math.ceil((config.height - newVal.y) / Proportion.value.y); let y = Math.ceil((config.height - newVal.y) / Proportion.value.y);
points[0].x = x; points[0].x = x;
points[0].y = y; points[0].y = y;
console.log(points[0])
isshowarray.value[0] = false; isshowarray.value[0] = false;
isactivearray.value[0] = false; isactivearray.value[0] = false;
setTimeout(() => { setTimeout(() => {
@ -492,8 +497,7 @@ export default defineComponent({
four[index].x = config.point4[index].def_x; four[index].x = config.point4[index].def_x;
four[index].y = config.point4[index].def_y; four[index].y = config.point4[index].def_y;
if (send) if (send) {
{
set?.setBlendingCorrection( set?.setBlendingCorrection(
$store.getters.GetTheCurrentlySelectedCamera[0], $store.getters.GetTheCurrentlySelectedCamera[0],
$store.getters.GetTheCurrentlySelectedCamera[1], $store.getters.GetTheCurrentlySelectedCamera[1],