@nativedesktop/test 0.4.21 → 0.4.22

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.
Files changed (2) hide show
  1. package/package.json +3 -3
  2. package/src/cursor.ts +5 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nativedesktop/test",
3
- "version": "0.4.21",
3
+ "version": "0.4.22",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/FormalSnake/NativeDesktop#readme",
@@ -22,7 +22,7 @@
22
22
  ".": "./src/index.ts"
23
23
  },
24
24
  "dependencies": {
25
- "@nativedesktop/host": "0.4.21",
26
- "@nativedesktop/react": "0.4.21"
25
+ "@nativedesktop/host": "0.4.22",
26
+ "@nativedesktop/react": "0.4.22"
27
27
  }
28
28
  }
package/src/cursor.ts CHANGED
@@ -15,6 +15,9 @@ export type CursorTarget = Locator | { x: number; y: number };
15
15
  export interface CursorButtonOptions {
16
16
  button?: "left" | "right" | "middle";
17
17
  clickCount?: number;
18
+ /** Modifier keys the press and release carry, for a cmd-click or a
19
+ * shift-click. */
20
+ modifiers?: ("command" | "shift" | "option" | "control")[];
18
21
  }
19
22
 
20
23
  export interface CursorMoveOptions {
@@ -66,8 +69,8 @@ export class Cursor {
66
69
  await this.move(target, opts);
67
70
  const clicks = opts.clickCount ?? 1;
68
71
  for (let n = 1; n <= clicks; n++) {
69
- await this.down({ button: opts.button, clickCount: n });
70
- await this.up({ button: opts.button, clickCount: n });
72
+ await this.down({ button: opts.button, clickCount: n, modifiers: opts.modifiers });
73
+ await this.up({ button: opts.button, clickCount: n, modifiers: opts.modifiers });
71
74
  }
72
75
  }
73
76