larksr_websdk 3.2.35 → 3.2.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -140,11 +140,30 @@ keyDown(key: string, isRepeat: boolean): void;
140
140
  * @returns 是否发送成功,如果key参数传递错误可能发送失败
141
141
  */
142
142
  keyUp(key: string): void;
143
- /**
143
+ /**
144
+ * 手柄接口消息按照 windows xbox 360 手柄标准定义,即包含 xbox 360 手柄的功能,如按钮,摇杆,扳机键。windows 上最多支持4个手柄,
145
+ * 当前版本服务端只处理1个手柄,后续会放开多个手柄的支持。接口中发送的按键值为对应的 windows 中定义的按键值。
144
146
  * 向云端发送手柄按钮按下事件
145
- * 參考 https://developer.mozilla.org/zh-CN/docs/Web/API/Gamepad_API/Using_the_Gamepad_API
146
- * @param userIndex 手柄的索引
147
- * @param button 按鍵
147
+ * 參考 js 中获取手柄事件,参考 https://developer.mozilla.org/zh-CN/docs/Web/API/Gamepad_API/Using_the_Gamepad_API
148
+ * @param userIndex 手柄的索引,硬件设备索引 0-3. 第一个连接的手柄为0,第二个为1,以此类推。
149
+ * @param button 按鍵 @see https://docs.microsoft.com/en-us/windows/win32/api/xinput/ns-xinput-xinput_gamepad
150
+ * export const enum XINPUT_BUTTONS {
151
+ * XINPUT_GAMEPAD_DPAD_UP = 0x0001,
152
+ * XINPUT_GAMEPAD_DPAD_DOWN = 0x0002,
153
+ * XINPUT_GAMEPAD_DPAD_LEFT = 0x0004,
154
+ * XINPUT_GAMEPAD_DPAD_RIGHT = 0x0008,
155
+ * XINPUT_GAMEPAD_START = 0x0010,
156
+ * XINPUT_GAMEPAD_BACK = 0x0020,
157
+ * XINPUT_GAMEPAD_LEFT_THUMB = 0x0040,
158
+ * XINPUT_GAMEPAD_RIGHT_THUMB = 0x0080,
159
+ * XINPUT_GAMEPAD_LEFT_SHOULDER = 0x0100,
160
+ * XINPUT_GAMEPAD_RIGHT_SHOULDER = 0x0200,
161
+ * XINPUT_GAMEPAD_A = 0x1000,
162
+ * XINPUT_GAMEPAD_B = 0x2000,
163
+ * XINPUT_GAMEPAD_X = 0x4000,
164
+ * XINPUT_GAMEPAD_Y = 0x8000,
165
+ * XINPUT_UNKNOWN = -1,
166
+ * }
148
167
  * @param isRepeat 是否重复按下
149
168
  * @returns
150
169
  */
@@ -162,18 +181,23 @@ gamepadButtonUp(userIndex: number, button: number): void;
162
181
  * 參考 https://developer.mozilla.org/zh-CN/docs/Web/API/Gamepad_API/Using_the_Gamepad_API
163
182
  * @param userIndex 手柄的索引
164
183
  * @param isleft 是否是左trigger
165
- * @param value trigger的值
184
+ * @param value trigger的值 扳机键的值 0-255
166
185
  * @returns
167
186
  */
168
187
  gamepadTrigger(userIndex: number, isleft: boolean, value: number): void;
169
188
  /**
170
189
  * 向云端发送手柄按摇杆的值,即 axes 值
171
- * 參考 https://developer.mozilla.org/zh-CN/docs/Web/API/Gamepad_API/Using_the_Gamepad_API
190
+ * win MAX
191
+ * |
192
+ * MIN-------------MAX
193
+ * |
194
+ * MIN
195
+ * js 中获取硬件手柄參考 https://developer.mozilla.org/zh-CN/docs/Web/API/Gamepad_API/Using_the_Gamepad_API
172
196
  * @param userIndex 手柄的索引
173
- * @param thumblx 手柄摇杆的x轴坐标
174
- * @param thumbly 手柄摇杆的y轴坐标
175
- * @param thumbrx 手柄摇杆的x轴相对坐标
176
- * @param thumbry 手柄摇杆的y轴相对坐标
197
+ * @param thumblx 左摇杆 X 值,-32767 到 32767
198
+ * @param thumbly 左摇杆 Y 值,-32767 到 32767
199
+ * @param thumbrx 右摇杆 X 值,-32767 到 32767
200
+ * @param thumbry 右摇杆 Y 值,-32767 到 32767
177
201
  * @returns
178
202
  */
179
203
  joystick(userIndex: number, thumblx: number, thumbly: number, thumbrx: number, thumbry: number): void;
@@ -275,4 +299,11 @@ larksr.on('aivoicedmresult', (e) => {
275
299
  * 采集一帧图像
276
300
  */
277
301
  captrueFrame(data: any)
302
+ /**
303
+ * 设置是否强制横屏显示内容.
304
+ * handelRootElementSize 必须设置为 true 才有作用。
305
+ * 要注意强制横屏模式下网页的坐标系xy和视觉上相反,如果通过外部输入 input 事件。要注意调整
306
+ * @param force 是否强制横屏
307
+ */
308
+ setMobileForceLandScape(force: boolean): void;
278
309
  ```
@@ -52,3 +52,15 @@ larksr.on('aivoicedmresult', (e) => {
52
52
  // 智能语音对话结果
53
53
  });
54
54
  ```
55
+
56
+ ## V3.2.37
57
+
58
+ ```typescript
59
+ /**
60
+ * 设置是否强制横屏显示内容.
61
+ * handelRootElementSize 必须设置为 true 才有作用。
62
+ * 要注意强制横屏模式下网页的坐标系xy和视觉上相反,如果通过外部输入 input 事件。要注意调整
63
+ * @param force 是否强制横屏
64
+ */
65
+ setMobileForceLandScape(force: boolean): void;
66
+ ```