Lines Matching refs:pointer

1 # @ohos.multimodalInput.pointer (Mouse Pointer)
3 The **pointer** module provides APIs related to pointer attribute management.
12 import { pointer } from '@kit.InputKit';
15 ## pointer.setPointerVisible
19 Sets the visible status of the mouse pointer. This API uses an asynchronous callback to return the …
27 … | Yes | Whether the mouse pointer is visible. The value **true** indicates that the…
42 pointer.setPointerVisible(true, (error: Error) => {
44 … console.log(`Set pointer visible failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
47 console.log(`Set pointer visible success`);
50 console.log(`Set pointer visible failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
54 ## pointer.setPointerVisible
58 Sets the visible status of the mouse pointer. This API uses a promise to return the result.
66 …le | boolean | Yes | Whether the mouse pointer is visible. The value **true** indicates that the…
86 pointer.setPointerVisible(false).then(() => {
87 console.log(`Set pointer visible success`);
90 console.log(`Set pointer visible failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
94 ## pointer.setPointerVisibleSync<sup>10+</sup>
98 Sets the visible status of the mouse pointer. This API returns the result synchronously.
106 …le | boolean | Yes | Whether the mouse pointer is visible. The value **true** indicates that the…
120 pointer.setPointerVisibleSync(false);
121 console.log(`Set pointer visible success`);
123 console.log(`Set pointer visible failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
127 ## pointer.isPointerVisible
131 Checks the visible status of the mouse pointer. This API uses an asynchronous callback to return th…
139 …k used to return the result. The value **true** indicates that the mouse pointer is displayed, and…
153 pointer.isPointerVisible((error: Error, visible: boolean) => {
155 … console.log(`Get pointer visible failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
158 console.log(`Get pointer visible success, visible: ${JSON.stringify(visible)}`);
161 console.log(`Get pointer visible failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
165 ## pointer.isPointerVisible
169 Checks the visible status of the mouse pointer. This API uses a promise to return the result.
183 pointer.isPointerVisible().then((visible: boolean) => {
184 console.log(`Get pointer visible success, visible: ${JSON.stringify(visible)}`);
187 console.log(`Get pointer visible failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
191 ## pointer.isPointerVisibleSync<sup>10+</sup>
195 Obtains the visible status of the mouse pointer. This API returns the result synchronously.
203 | boolean | Visible status of the mouse pointer. The value **true** indicates that the mouse pointe…
209 let visible: boolean = pointer.isPointerVisibleSync();
210 console.log(`Get pointer visible success, visible: ${JSON.stringify(visible)}`);
212 console.log(`Get pointer visible failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
216 ## pointer.getPointerStyle
220 Obtains the mouse pointer style. This API uses an asynchronous callback to return the result.
257 pointer.getPointerStyle(windowId, (error: Error, style: pointer.PointerStyle) => {
258 console.log(`Get pointer style success, style: ${JSON.stringify(style)}`);
261 console.log(`Get pointer style failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
266 ## pointer.getPointerStyle
270 Obtains the mouse pointer style. This API uses a promise to return the result.
312 pointer.getPointerStyle(windowId).then((style: pointer.PointerStyle) => {
313 console.log(`Get pointer style success, style: ${JSON.stringify(style)}`);
316 console.log(`Get pointer style failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
321 ## pointer.getPointerStyleSync<sup>10+</sup>
325 Obtains the mouse pointer style. This API returns the result synchronously.
333 …ber | Yes | Window ID.<br>The default value is **-1**, indicating the global mouse pointer style.|
339 | [PointerStyle](#pointerstyle) | Mouse pointer style.|
352 import { pointer } from '@kit.InputKit';
356 let style: pointer.PointerStyle = pointer.getPointerStyleSync(windowId);
357 console.log(`Get pointer style success, style: ${JSON.stringify(style)}`);
359 console.log(`Get pointer style failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
363 ## pointer.setPointerStyle
367 Sets the mouse pointer style. This API uses an asynchronous callback to return the result.
404 pointer.setPointerStyle(windowId, pointer.PointerStyle.CROSS, error => {
405 console.log(`Set pointer style success`);
408 console.log(`Set pointer style failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
412 ## pointer.setPointerStyle
416 Sets the mouse pointer style. This API uses a promise to return the result.
458 pointer.setPointerStyle(windowId, pointer.PointerStyle.CROSS).then(() => {
459 console.log(`Set pointer style success`);
462 console.log(`Set pointer style failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
467 ## pointer.setPointerStyleSync<sup>10+</sup>
471 Sets the mouse pointer style. This API returns the result synchronously.
506 pointer.setPointerStyleSync(windowId, pointer.PointerStyle.CROSS);
507 console.log(`Set pointer style success`);
539 Enumerates mouse pointer styles.
564 | HAND_POINTING | 19 | Hand-shaped pointer |![Hand_Poniting.png](./figures/Ha…
590 ## pointer.setCustomCursor<sup>11+</sup>
635 pointer.setCustomCursor(windowId, pixelMap).then(() => {
646 ## pointer.setCustomCursorSync<sup>11+</sup>
685 pointer.setCustomCursorSync(windowId, pixelMap, 25, 25);