Skip to content

Commit db6fa31

Browse files
committed
update MobileKeyboardZoneToKeyMapping to MobileKeyboardBtns
1 parent cb39e39 commit db6fa31

File tree

2 files changed

+10
-32
lines changed

2 files changed

+10
-32
lines changed

docs/develop/share/module_MobileKeyboard.ts

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { dispatchKeyToEvent } from "./module_ProjectAPIs";
22
import type {
3-
MobileKeyboardZoneToKeyMapping,
3+
MobileKeyboardBtns,
44
MobileKeyboardType,
55
} from "./module_ProjectAPIs";
66

77
export type KeyboardConfig = {
88
type: MobileKeyboardType;
9-
mapping: MobileKeyboardZoneToKeyMapping;
9+
btns: MobileKeyboardBtns;
1010
};
1111
export type UI = any;
1212

@@ -16,10 +16,10 @@ export declare function useModal<T>(
1616

1717
export declare function KeyboardEditor(
1818
props: {
19-
zoneToKeyMapping: MobileKeyboardZoneToKeyMapping;
19+
mobileKeyboardBtns: MobileKeyboardBtns;
2020
},
2121
emits: {
22-
resolved: (result: MobileKeyboardZoneToKeyMapping) => void;
22+
resolved: (result: MobileKeyboardBtns) => void;
2323
}
2424
): UI;
2525

@@ -31,7 +31,6 @@ export declare function KeyboardEditor(
3131
*
3232
* ## Props:
3333
* - `ZoneToKeyMapping`: keyboard zone to key mapping configuration
34-
* - `systemKeyConfig`: Optional array to customize system keys.If omitted, no system keys will be rendered.
3534
*
3635
* ## Slots:
3736
* - `gameView`: Should contain ProjectRunner component
@@ -52,34 +51,13 @@ export declare function KeyboardEditor(
5251

5352
export declare function MobileKeyboardView(
5453
props: {
55-
zoneToKeyMapping: MobileKeyboardZoneToKeyMapping;
54+
mobileKeyboardBtns: MobileKeyboardBtns;
5655
},
5756
emits: {
5857
close: [];
5958
rerun: [];
6059
}
6160
): UI;
62-
// {
63-
// const zones = Object.keys(ZoneToKeyMapping);
64-
// const zoneToKey = ZoneToKeyMapping;
65-
// const handleKeyEvent = (type: string, key: string, code: string) => {
66-
// dispatchKeyToEvent(type, code);
67-
// };
68-
69-
// return `
70-
// <div className="phone-layout">
71-
// <slot name="gameView">
72-
// </slot>
73-
// <div className="keyboard-zones">
74-
// ${keyButtons}
75-
// </div>
76-
// <div className="systemA" @click="emit('rerun')">
77-
// </div>
78-
// <div className="systemB" @click="emit('close')">
79-
// </div>
80-
// </div>
81-
// `;
82-
// }
8361

8462
// key UI in Keyboard. provide to MobileKeyboardView and MobileKeyboardEidt
8563
// active is used to indicate whether a button has functionality(onKeyEvent).

docs/develop/share/module_ProjectAPIs.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export type KeyBtn = {
1212
/** The vertical coordinate of the left top corner of the key (pixels). */
1313
posY: number;
1414
};
15-
export type MobileKeyboardZoneToKeyMapping = KeyBtn[];
15+
export type MobileKeyboardBtns = KeyBtn[];
1616
/**
1717
* Mobile keyboard type
1818
* - NoKeyboard: No keyboard
@@ -63,7 +63,7 @@ export type ProjectData = {
6363
/** Mobile keyboard type */
6464
mobileKeyboardType: MobileKeyboardType;
6565
/** Zone to key mapping for mobile keyboard */
66-
mobileKeyboardZoneToKey?: MobileKeyboardZoneToKeyMapping;
66+
mobileKeyboardBtns?: MobileKeyboardBtns;
6767
};
6868

6969
/**
@@ -81,7 +81,7 @@ export type AddProjectParams = {
8181
/** Mobile keyboard type */
8282
mobileKeyboardType: MobileKeyboardType;
8383
/** Zone to key mapping for mobile keyboard */
84-
mobileKeyboardZoneToKey?: MobileKeyboardZoneToKeyMapping;
84+
mobileKeyboardBtns?: MobileKeyboardBtns;
8585
};
8686

8787
/**
@@ -97,7 +97,7 @@ export type AddProjectByRemixParams = {
9797
/** Mobile keyboard type */
9898
mobileKeyboardType: MobileKeyboardType;
9999
/** Zone to key mapping for mobile keyboard */
100-
mobileKeyboardZoneToKey?: MobileKeyboardZoneToKeyMapping;
100+
mobileKeyboardBtns?: MobileKeyboardBtns;
101101
};
102102

103103
/**
@@ -117,7 +117,7 @@ export type UpdateProjectParams = {
117117
/** Mobile keyboard type */
118118
mobileKeyboardType?: MobileKeyboardType;
119119
/** Zone to key mapping for mobile keyboard */
120-
mobileKeyboardZoneToKey?: MobileKeyboardZoneToKeyMapping;
120+
mobileKeyboardBtns?: MobileKeyboardBtns;
121121
};
122122

123123
/**

0 commit comments

Comments
 (0)