feat(KeyBoard): add pointerId setting

This commit is contained in:
AkiChase 2024-04-30 19:30:51 +08:00
parent 104716ae24
commit 2447cb8e66
4 changed files with 40 additions and 8 deletions

View File

@ -148,7 +148,7 @@ function showSetting() {
"keyboardElement"
) as HTMLElement;
const maxWidth = keyboardElement.clientWidth - 150;
const maxHeight = keyboardElement.clientHeight - 220;
const maxHeight = keyboardElement.clientHeight - 300;
settingPosX.value = Math.min(keyMapping.value.posX + 25, maxWidth);
settingPosY.value = Math.min(keyMapping.value.posY - 25, maxHeight);
@ -219,6 +219,14 @@ function showSetting() {
@update:value="keyboardStore.edited = true"
/>
</NFormItem>
<NFormItem label="触点ID">
<NInputNumber
v-model:value="keyMapping.pointerId"
:min="0"
placeholder="请输入触点ID"
@update:value="keyboardStore.edited = true"
/>
</NFormItem>
<NFormItem label="备注">
<NInput
v-model:value="keyMapping.note"
@ -277,7 +285,7 @@ function showSetting() {
padding: 10px 20px;
box-sizing: border-box;
width: 150px;
height: 220px;
height: 300px;
border-radius: 5px;
border: 2px solid var(--light-color);
background-color: var(--bg-color);

View File

@ -70,7 +70,7 @@ function showSetting() {
"keyboardElement"
) as HTMLElement;
const maxWidth = keyboardElement.clientWidth - 150;
const maxHeight = keyboardElement.clientHeight - 220;
const maxHeight = keyboardElement.clientHeight - 300;
settingPosX.value = Math.min(keyMapping.value.posX + 40, maxWidth);
settingPosY.value = Math.min(keyMapping.value.posY - 30, maxHeight);
@ -133,6 +133,14 @@ function showSetting() {
@update:value="keyboardStore.edited = true"
/>
</NFormItem>
<NFormItem label="触点ID">
<NInputNumber
v-model:value="keyMapping.pointerId"
:min="0"
placeholder="请输入触点ID"
@update:value="keyboardStore.edited = true"
/>
</NFormItem>
<NFormItem label="备注">
<NInput
v-model:value="keyMapping.note"
@ -151,7 +159,7 @@ function showSetting() {
padding: 10px 20px;
box-sizing: border-box;
width: 150px;
height: 220px;
height: 300px;
border-radius: 5px;
border: 2px solid var(--light-color);
background-color: var(--bg-color);

View File

@ -138,7 +138,7 @@ function showSetting() {
) as HTMLElement;
// setting
const maxWidth = keyboardElement.clientWidth - 200;
const maxHeight = keyboardElement.clientHeight - 350;
const maxHeight = keyboardElement.clientHeight - 420;
settingPosX.value = Math.min(keyMapping.value.posX + 40, maxWidth);
settingPosY.value = Math.min(keyMapping.value.posY - 30, maxHeight);
updateRangeIndicator(keyboardElement);
@ -263,6 +263,14 @@ function updateRangeIndicator(element?: HTMLElement) {
@update:value="keyboardStore.edited = true"
/>
</NFormItem>
<NFormItem label="触点ID">
<NInputNumber
v-model:value="keyMapping.pointerId"
:min="0"
placeholder="请输入触点ID"
@update:value="keyboardStore.edited = true"
/>
</NFormItem>
<NFormItem label="备注">
<NInput
v-model:value="keyMapping.note"
@ -300,7 +308,7 @@ function updateRangeIndicator(element?: HTMLElement) {
padding: 10px 20px;
box-sizing: border-box;
width: 200px;
height: 350px;
height: 420px;
border-radius: 5px;
border: 2px solid var(--light-color);
background-color: var(--bg-color);

View File

@ -83,7 +83,7 @@ function showSetting() {
"keyboardElement"
) as HTMLElement;
const maxWidth = keyboardElement.clientWidth - 150;
const maxHeight = keyboardElement.clientHeight - 220;
const maxHeight = keyboardElement.clientHeight - 300;
settingPosX.value = Math.min(
keyMapping.value.posX + offset.value + 10,
@ -195,6 +195,14 @@ function showSetting() {
@update:value="keyboardStore.edited = true"
/>
</NFormItem>
<NFormItem label="触点ID">
<NInputNumber
v-model:value="keyMapping.pointerId"
:min="0"
placeholder="请输入触点ID"
@update:value="keyboardStore.edited = true"
/>
</NFormItem>
<NFormItem label="备注">
<NInput
v-model:value="keyMapping.note"
@ -213,7 +221,7 @@ function showSetting() {
padding: 10px 20px;
box-sizing: border-box;
width: 150px;
height: 220px;
height: 300px;
border-radius: 5px;
border: 2px solid var(--light-color);
background-color: var(--bg-color);