|
@@ -641,7 +641,25 @@ const initHand = () => {
|
|
|
}
|
|
|
//举左手
|
|
|
if (e?.data?.result == "left_hand") {
|
|
|
-
|
|
|
+ //确认退出
|
|
|
+ if (exit.value) {
|
|
|
+ exit.value = 0;
|
|
|
+ //确认退出
|
|
|
+ let keyEvent: any = null;
|
|
|
+ keyEvent = new KeyboardEvent('keydown', {
|
|
|
+ key: 'Enter', // 键值
|
|
|
+ code: 'Enter', // 键盘代码
|
|
|
+ keyCode: 13, // 旧的键盘代码
|
|
|
+ which: 13, // 新的键盘代码
|
|
|
+ shiftKey: false, // 是否按下Shift键
|
|
|
+ ctrlKey: false, // 是否按下Ctrl键
|
|
|
+ metaKey: false, // 是否按下Meta键(Win键或Command键)
|
|
|
+ bubbles: true, // 事件是否冒泡
|
|
|
+ cancelable: true // 是否可以取消事件的默认行为
|
|
|
+ });
|
|
|
+ document.activeElement?.dispatchEvent(keyEvent);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
//开始识别
|
|
|
if (needStart.value && examState.value < 41) {
|
|
|
getOpenOneTestAndStartFace();
|
|
@@ -661,24 +679,6 @@ const initHand = () => {
|
|
|
}
|
|
|
return false;
|
|
|
}
|
|
|
- //确认退出
|
|
|
- if (exit.value) {
|
|
|
- exit.value = 0;
|
|
|
- //确认退出
|
|
|
- let keyEvent: any = null;
|
|
|
- keyEvent = new KeyboardEvent('keydown', {
|
|
|
- key: 'Enter', // 键值
|
|
|
- code: 'Enter', // 键盘代码
|
|
|
- keyCode: 13, // 旧的键盘代码
|
|
|
- which: 13, // 新的键盘代码
|
|
|
- shiftKey: false, // 是否按下Shift键
|
|
|
- ctrlKey: false, // 是否按下Ctrl键
|
|
|
- metaKey: false, // 是否按下Meta键(Win键或Command键)
|
|
|
- bubbles: true, // 事件是否冒泡
|
|
|
- cancelable: true // 是否可以取消事件的默认行为
|
|
|
- });
|
|
|
- document.activeElement?.dispatchEvent(keyEvent);
|
|
|
- }
|
|
|
}
|
|
|
//退出
|
|
|
if (e?.data?.result == "exit") {
|