diff --git a/zh-cn/application-dev/reference/apis/js-apis-pointer.md b/zh-cn/application-dev/reference/apis/js-apis-pointer.md index f6d959f0221be8f6fb5c1115fd81ac4bc80f0c5e..3a4617a34a5e92ec9170f119b9b1dba53f9347e9 100755 --- a/zh-cn/application-dev/reference/apis/js-apis-pointer.md +++ b/zh-cn/application-dev/reference/apis/js-apis-pointer.md @@ -1344,4 +1344,385 @@ try { } catch (error) { console.log(`getTouchpadPointerSpeed failed, error: ${JSON.stringify(error, [`code`, `message`])}`); } +``` + +## pointer.setTouchpadPinchSwitch10+ + +setTouchpadPinchSwitch(state: boolean, callback: AsyncCallback\): void + +设置触控板双指捏合功能开关,使用AsyncCallback异步方式返回结果。 + +**系统能力**:SystemCapability.MultimodalInput.Input.Pointer + +**系统API**: 此接口为系统接口。 + +**参数**: + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------- | ---- | ------------------------------------- | +| state | boolean | 是 |触控板双指捏合功能开关开启状态。 true代表开启,false代表关闭,默认开启。 | +| callback | AsyncCallback\ | 是 | 回调函数。 | + +**示例**: + +```js +try { + pointer.setTouchpadTapSwitch(true, (error) => { + if (error) { + console.log(`setTouchpadPinchSwitch failed, error: ${JSON.stringify(error, [`code`, `message`])}`); + return; + } + console.log(`setTouchpadPinchSwitch success`); + }); +} catch (error) { + console.log(`setTouchpadPinchSwitch failed, error: ${JSON.stringify(error, [`code`, `message`])}`); +} +``` + +## pointer.setTouchpadPinchSwitch10+ + +setTouchpadPinchSwitch(state: boolean): Promise\ + +设置触控板双指捏合功能开关,使用Promise异步方式返回结果。 + +**系统能力**:SystemCapability.MultimodalInput.Input.Pointer + +**系统API**: 此接口为系统接口。 + +**参数**: + +| 参数名 | 类型 | 必填 | 说明 | +| ----- | ------ | ---- | ----------------------------------- | +| state | boolean| 是 | 触控板双指捏合功能开关开启状态。 true代表开启,false代表关闭,默认开启。 | + +**返回值**: + +| 参数 | 说明 | +| ------------------- | ---------------- | +| Promise\ | Promise对象。 | + +**示例**: + +```js +try { + pointer.setTouchpadPinchSwitch(false).then(() => { + console.log(`setTouchpadPinchSwitch success`); + }); +} catch (error) { + console.log(`setTouchpadPinchSwitch failed, error: ${JSON.stringify(error, [`code`, `message`])}`); +} +``` + +## pointer.getTouchpadPinchSwitch10+ + +getTouchpadPinchSwitch(callback: AsyncCallback\): void + +获取触控板双指捏合功能开启状态,使用AsyncCallback异步方式返回结果。 + +**系统能力**:SystemCapability.MultimodalInput.Input.Pointer + +**系统API**: 此接口为系统接口。 + +**参数**: + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | --------------------------- | ---- | -------------- | +| callback | AsyncCallback\ | 是 | 回调函数,异步返回触控板双指捏合功能开启状态。 | + +**示例**: + +```js +try { + pointer.getTouchpadPinchSwitch((error, state) => { + console.log(`getTouchpadPinchSwitch success, state: ${JSON.stringify(state)}`); + }); +} catch (error) { + console.log(`getTouchpadPinchSwitch failed, error: ${JSON.stringify(error, [`code`, `message`])}`); +} +``` + +## pointer.getTouchpadPinchSwitch10+ + +getTouchpadPinchSwitch(): Promise\ + +获取触控板双指捏合功能开启状态,使用Promise异步方式返回结果。 + +**系统能力**:SystemCapability.MultimodalInput.Input.Pointer + +**系统API**: 此接口为系统接口。 + +**返回值**: + +| 参数 | 说明 | +| --------------------- | ------------------- | +| Promise\ | Promise实例,异步返回触控板双指捏合功能开启状态。 | + +**示例**: + +```js +try { + pointer.getTouchpadPinchSwitch().then((state) => { + console.log(`getTouchpadPinchSwitch success, state: ${JSON.stringify(state)}`); + }); +} catch (error) { + console.log(`getTouchpadPinchSwitch failed, error: ${JSON.stringify(error, [`code`, `message`])}`); +} +``` + +## pointer.setTouchpadSwipeSwitch10+ + +setTouchpadSwipeSwitch(state: boolean, callback: AsyncCallback\): void + +设置触控板多指滑动功能开关,使用AsyncCallback异步方式返回结果。 + +**系统能力**:SystemCapability.MultimodalInput.Input.Pointer + +**系统API**: 此接口为系统接口。 + +**参数**: + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------- | ---- | ------------------------------------- | +| state | boolean | 是 |触控板多指滑动开关开启状态。 true代表多指滑动开启,false代表多指滑动关闭,默认开启。 | +| callback | AsyncCallback\ | 是 | 回调函数。 | + +**示例**: + +```js +try { + pointer.setTouchpadSwipeSwitch(true, (error) => { + if (error) { + console.log(`setTouchpadSwipeSwitch failed, error: ${JSON.stringify(error, [`code`, `message`])}`); + return; + } + console.log(`setTouchpadSwipeSwitch success`); + }); +} catch (error) { + console.log(`setTouchpadSwipeSwitch failed, error: ${JSON.stringify(error, [`code`, `message`])}`); +} +``` + +## pointer.setTouchpadSwipeSwitch10+ + +setTouchpadSwipeSwitch(state: boolean): Promise\ + +设置触控板多指滑动功能开关,使用Promise异步方式返回结果。 + +**系统能力**:SystemCapability.MultimodalInput.Input.Pointer + +**系统API**: 此接口为系统接口。 + +**参数**: + +| 参数名 | 类型 | 必填 | 说明 | +| ----- | ------ | ---- | ----------------------------------- | +| state | boolean| 是 | 触控板多指滑动功能开关开启状态。 true代表多指滑动开启,false代表多指滑动关闭,默认开启。 | + +**返回值**: + +| 参数 | 说明 | +| ------------------- | ---------------- | +| Promise\ | Promise对象。 | + +**示例**: + +```js +try { + pointer.setTouchpadSwipeSwitch(false).then(() => { + console.log(`setTouchpadSwipeSwitch success`); + }); +} catch (error) { + console.log(`setTouchpadSwipeSwitch failed, error: ${JSON.stringify(error, [`code`, `message`])}`); +} +``` + +## pointer.getTouchpadSwipeSwitch10+ + +getTouchpadSwipeSwitch(callback: AsyncCallback\): void + +获取触控板多指滑动功能开启状态,使用AsyncCallback异步方式返回结果。 + +**系统能力**:SystemCapability.MultimodalInput.Input.Pointer + +**系统API**: 此接口为系统接口。 + +**参数**: + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | --------------------------- | ---- | -------------- | +| callback | AsyncCallback\ | 是 | 回调函数,异步返回触控板多指滑动功能开启状态。 | + +**示例**: + +```js +try { + pointer.getTouchpadSwipeSwitch((error, state) => { + console.log(`getTouchpadSwipeSwitch success, state: ${JSON.stringify(state)}`); + }); +} catch (error) { + console.log(`getTouchpadSwipeSwitch failed, error: ${JSON.stringify(error, [`code`, `message`])}`); +} +``` + +## pointer.getTouchpadSwipeSwitch10+ + +getTouchpadSwipeSwitch(): Promise\ + +获取触控板多指滑动功能开启状态,使用Promise异步方式返回结果。 + +**系统能力**:SystemCapability.MultimodalInput.Input.Pointer + +**系统API**: 此接口为系统接口。 + +**返回值**: + +| 参数 | 说明 | +| --------------------- | ------------------- | +| Promise\ | Promise实例,异步返回触控板多指滑动功能开启状态。 | + +**示例**: + +```js +try { + pointer.getTouchpadSwipeSwitch().then((state) => { + console.log(`getTouchpadSwipeSwitch success, state: ${JSON.stringify(state)}`); + }); +} catch (error) { + console.log(`getTouchpadSwipeSwitch failed, error: ${JSON.stringify(error, [`code`, `message`])}`); +} +``` + +## RightClickType10+ + +右键菜单触发方式。 + +**系统能力**:SystemCapability.MultimodalInput.Input.Pointer + +| 名称 | 值 | 说明 | +| -------------------------------- | ---- | ------ | +| TOUCHPAD_RIGHT_BUTTON | 1 |触控板右键区域。 | +| TOUCHPAD_LEFT_BUTTON | 2 |触控板左键区域。 | +| TOUCHPAD_TWO_FINGER_TAP | 3 |双指轻击或按压触控板。| + +## pointer.setTouchpadRightClickType10+ + +setTouchpadRightClickType(type: RightClickType, callback: AsyncCallback\): void + +设置触控板右键菜单类型,使用AsyncCallback异步方式返回结果。 + +**系统能力**:SystemCapability.MultimodalInput.Input.Pointer + +**系统API**: 此接口为系统接口。 + +**参数**: + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------- | ---- | ------------------------------------- | +| type| RightClickType| 是 |type代表触控板右键菜单类型。
- TOUCHPAD_RIGHT_BUTTON:触控板右键区域。
- TOUCHPAD_LEFT_BUTTON:触控板左键区域。
- TOUCHPAD_TWO_FINGER_TAP:双指轻击或按压触控板。
默认为TOUCHPAD_RIGHT_BUTTON 。 | +| callback | AsyncCallback\ | 是 | 回调函数。 | + +**示例**: + +```js +try { + pointer.setTouchpadRightClickType(RightClickType::TOUCHPAD_RIGHT_BUTTON , (error) => { + if (error) { + console.log(`setTouchpadRightClickType, error: ${JSON.stringify(error, [`code`, `message`])}`); + return; + } + console.log(`setTouchpadRightClickType success`); + }); +} catch (error) { + console.log(`setTouchpadRightClickType failed, error: ${JSON.stringify(error, [`code`, `message`])}`); +} +``` + +## pointer.setTouchpadRightClickType10+ + +setTouchpadRightClickType(type: RightClickType): Promise\ + +设置触控板右键菜单类型,使用Promise异步方式返回结果。 + +**系统能力**:SystemCapability.MultimodalInput.Input.Pointer + +**系统API**: 此接口为系统接口。 + +**参数**: + +| 参数名 | 类型 | 必填 | 说明 | +| ----- | ------ | ---- | ----------------------------------- | +| type| RightClickType| 是 | type代表触控板右键菜单类型。
- TOUCHPAD_RIGHT_BUTTON:触控板右键区域。
- TOUCHPAD_LEFT_BUTTON:触控板左键区域。
- TOUCHPAD_TWO_FINGER_TAP:双指轻击或按压触控板。
默认为TOUCHPAD_RIGHT_BUTTON 。 | + +**返回值**: + +| 参数 | 说明 | +| ------------------- | ---------------- | +| Promise\ | Promise对象。 | + +**示例**: + +```js +try { + pointer.setTouchpadRightClickType(RightClickType::TOUCHPAD_RIGHT_BUTTON ).then(() => { + console.log(`setTouchpadRightClickType success`); + }); +} catch (error) { + console.log(`setTouchpadRightClickType failed, error: ${JSON.stringify(error, [`code`, `message`])}`); +} +``` + +## pointer.getTouchpadRightClickType10+ + +getTouchpadRightClickType(callback: AsyncCallback\): void + +获取触控板右键菜单类型,使用AsyncCallback异步方式返回结果。 + +**系统能力**:SystemCapability.MultimodalInput.Input.Pointer + +**系统API**: 此接口为系统接口。 + +**参数**: + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | --------------------------- | ---- | -------------- | +| callback | AsyncCallback\ | 是 | 回调函数,异步返回触控板右键菜单类型。 | + +**示例**: + +```js +try { + pointer.getTouchpadRightClickType((error, type) => { + console.log(`getTouchpadRightClickType success, type: ${JSON.stringify(type)}`); + }); +} catch (error) { + console.log(`getTouchpadRightClickType failed, error: ${JSON.stringify(error, [`code`, `message`])}`); +} +``` + +## pointer.getTouchpadRightClickType10+ + +getTouchpadRightClickType(): Promise\ + +获取触控板右键菜单类型,使用Promise异步方式返回结果。 + +**系统能力**:SystemCapability.MultimodalInput.Input.Pointer + +**系统API**: 此接口为系统接口。 + +**返回值**: + +| 参数 | 说明 | +| --------------------- | ------------------- | +| Promise\ | Promise实例,异步返回触控板右键菜单类型。 | + +**示例**: + +```js +try { + pointer.getTouchpadRightClickType().then((type) => { + console.log(`getTouchpadRightClickType success, typeed: ${JSON.stringify(type)}`); + }); +} catch (error) { + console.log(`getTouchpadRightClickType failed, error: ${JSON.stringify(error, [`code`, `message`])}`); +} ``` \ No newline at end of file