MaaFw 4.4.1__py3-none-macosx_13_0_x86_64.whl → 4.5.0b1__py3-none-macosx_13_0_x86_64.whl

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.

Potentially problematic release.


This version of MaaFw might be problematic. Click here for more details.

Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
maa/bin/libMaaUtils.dylib CHANGED
Binary file
Binary file
Binary file
Binary file
maa/controller.py CHANGED
@@ -56,7 +56,21 @@ class Controller:
56
56
  return self._gen_ctrl_job(ctrl_id)
57
57
 
58
58
  def post_press_key(self, key: int) -> Job:
59
- ctrl_id = Library.framework().MaaControllerPostPressKey(self._handle, key)
59
+ """
60
+ Deprecated: Use post_click_key instead.
61
+ """
62
+ return self.post_click_key(key)
63
+
64
+ def post_click_key(self, key: int) -> Job:
65
+ ctrl_id = Library.framework().MaaControllerPostClickKey(self._handle, key)
66
+ return self._gen_ctrl_job(ctrl_id)
67
+
68
+ def post_key_down(self, key: int) -> Job:
69
+ ctrl_id = Library.framework().MaaControllerPostKeyDown(self._handle, key)
70
+ return self._gen_ctrl_job(ctrl_id)
71
+
72
+ def post_key_up(self, key: int) -> Job:
73
+ ctrl_id = Library.framework().MaaControllerPostKeyUp(self._handle, key)
60
74
  return self._gen_ctrl_job(ctrl_id)
61
75
 
62
76
  def post_input_text(self, text: str) -> Job:
@@ -216,12 +230,22 @@ class Controller:
216
230
  c_int32,
217
231
  ]
218
232
 
219
- Library.framework().MaaControllerPostPressKey.restype = MaaCtrlId
220
- Library.framework().MaaControllerPostPressKey.argtypes = [
233
+ Library.framework().MaaControllerPostClickKey.restype = MaaCtrlId
234
+ Library.framework().MaaControllerPostClickKey.argtypes = [
221
235
  MaaControllerHandle,
222
236
  c_int32,
223
237
  ]
224
238
 
239
+ Library.framework().MaaControllerPostKeyDown.restype = MaaCtrlId
240
+ Library.framework().MaaControllerPostKeyDown.argtypes = [
241
+ MaaControllerHandle,
242
+ c_int32,
243
+ ]
244
+ Library.framework().MaaControllerPostKeyUp.restype = MaaCtrlId
245
+ Library.framework().MaaControllerPostKeyUp.argtypes = [
246
+ MaaControllerHandle,
247
+ c_int32,
248
+ ]
225
249
  Library.framework().MaaControllerPostInputText.restype = MaaCtrlId
226
250
  Library.framework().MaaControllerPostInputText.argtypes = [
227
251
  MaaControllerHandle,
@@ -440,8 +464,10 @@ class CustomController(Controller):
440
464
  CustomController._c_touch_down_agent,
441
465
  CustomController._c_touch_move_agent,
442
466
  CustomController._c_touch_up_agent,
443
- CustomController._c_press_key_agent,
467
+ CustomController._c_click_key_agent,
444
468
  CustomController._c_input_text_agent,
469
+ CustomController._c_key_down_agent,
470
+ CustomController._c_key_up_agent,
445
471
  )
446
472
 
447
473
  self._handle = Library.framework().MaaCustomControllerCreate(
@@ -514,13 +540,21 @@ class CustomController(Controller):
514
540
  raise NotImplementedError
515
541
 
516
542
  @abstractmethod
517
- def press_key(self, keycode: int) -> bool:
543
+ def click_key(self, keycode: int) -> bool:
518
544
  raise NotImplementedError
519
545
 
520
546
  @abstractmethod
521
547
  def input_text(self, text: str) -> bool:
522
548
  raise NotImplementedError
523
549
 
550
+ @abstractmethod
551
+ def key_down(self, keycode: int) -> bool:
552
+ raise NotImplementedError
553
+
554
+ @abstractmethod
555
+ def key_up(self, keycode: int) -> bool:
556
+ raise NotImplementedError
557
+
524
558
  @staticmethod
525
559
  @MaaCustomControllerCallbacks.ConnectFunc
526
560
  def _c_connect_agent(
@@ -703,8 +737,40 @@ class CustomController(Controller):
703
737
  return int(self.touch_up(int(c_contact)))
704
738
 
705
739
  @staticmethod
706
- @MaaCustomControllerCallbacks.PressKeyFunc
707
- def _c_press_key_agent(
740
+ @MaaCustomControllerCallbacks.ClickKeyFunc
741
+ def _c_click_key_agent(
742
+ c_keycode: ctypes.c_int32,
743
+ trans_arg: ctypes.c_void_p,
744
+ ) -> int:
745
+ if not trans_arg:
746
+ return int(False)
747
+
748
+ self: CustomController = ctypes.cast(
749
+ trans_arg,
750
+ ctypes.py_object,
751
+ ).value
752
+
753
+ return int(self.click_key(int(c_keycode)))
754
+
755
+ @staticmethod
756
+ @MaaCustomControllerCallbacks.KeyDownFunc
757
+ def _c_key_down_agent(
758
+ c_keycode: ctypes.c_int32,
759
+ trans_arg: ctypes.c_void_p,
760
+ ) -> int:
761
+ if not trans_arg:
762
+ return int(False)
763
+
764
+ self: CustomController = ctypes.cast(
765
+ trans_arg,
766
+ ctypes.py_object,
767
+ ).value
768
+
769
+ return int(self.key_down(int(c_keycode)))
770
+
771
+ @staticmethod
772
+ @MaaCustomControllerCallbacks.KeyUpFunc
773
+ def _c_key_up_agent(
708
774
  c_keycode: ctypes.c_int32,
709
775
  trans_arg: ctypes.c_void_p,
710
776
  ) -> int:
@@ -716,7 +782,7 @@ class CustomController(Controller):
716
782
  ctypes.py_object,
717
783
  ).value
718
784
 
719
- return int(self.press_key(int(c_keycode)))
785
+ return int(self.key_up(int(c_keycode)))
720
786
 
721
787
  @staticmethod
722
788
  @MaaCustomControllerCallbacks.InputTextFunc
maa/define.py CHANGED
@@ -66,11 +66,12 @@ class MaaGlobalOptionEnum(IntEnum):
66
66
  # value: bool, eg: true; val_size: sizeof(bool)
67
67
  SaveDraw = 2
68
68
 
69
+ # Deprecated
69
70
  # Dump all screenshots and actions
70
71
  #
71
72
  # Recording will evaluate to true if any of this or MaaCtrlOptionEnum::MaaCtrlOption_Recording
72
73
  # is true. value: bool, eg: true; val_size: sizeof(bool)
73
- Recording = 3
74
+ # Recording = 3
74
75
 
75
76
  # The level of log output to stdout
76
77
  #
@@ -105,10 +106,11 @@ class MaaCtrlOptionEnum(IntEnum):
105
106
  # value: bool, eg: true; val_size: sizeof(bool)
106
107
  ScreenshotUseRawSize = 3
107
108
 
109
+ # Deprecated
108
110
  # Dump all screenshots and actions
109
111
  # this option will || with MaaGlobalOptionEnum.Recording
110
112
  # value: bool, eg: true; val_size: sizeof(bool)
111
- Recording = 5
113
+ # Recording = 5
112
114
 
113
115
 
114
116
  class MaaInferenceDeviceEnum(IntEnum):
@@ -338,7 +340,7 @@ class MaaCustomControllerCallbacks(ctypes.Structure):
338
340
  ctypes.c_int32,
339
341
  ctypes.c_void_p,
340
342
  )
341
- PressKeyFunc = FUNCTYPE(
343
+ ClickKeyFunc = FUNCTYPE(
342
344
  MaaBool,
343
345
  ctypes.c_int32,
344
346
  ctypes.c_void_p,
@@ -348,6 +350,16 @@ class MaaCustomControllerCallbacks(ctypes.Structure):
348
350
  ctypes.c_char_p,
349
351
  ctypes.c_void_p,
350
352
  )
353
+ KeyDownFunc = FUNCTYPE(
354
+ MaaBool,
355
+ ctypes.c_int32,
356
+ ctypes.c_void_p,
357
+ )
358
+ KeyUpFunc = FUNCTYPE(
359
+ MaaBool,
360
+ ctypes.c_int32,
361
+ ctypes.c_void_p,
362
+ )
351
363
  _fields_ = [
352
364
  ("connect", ConnectFunc),
353
365
  ("request_uuid", RequestUuidFunc),
@@ -359,8 +371,10 @@ class MaaCustomControllerCallbacks(ctypes.Structure):
359
371
  ("touch_down", TouchDownFunc),
360
372
  ("touch_move", TouchMoveFunc),
361
373
  ("touch_up", TouchUpFunc),
362
- ("press_key", PressKeyFunc),
374
+ ("click_key", ClickKeyFunc),
363
375
  ("input_text", InputTextFunc),
376
+ ("key_down", KeyDownFunc),
377
+ ("key_up", KeyUpFunc),
364
378
  ]
365
379
 
366
380
 
maa/tasker.py CHANGED
@@ -136,14 +136,10 @@ class Tasker:
136
136
 
137
137
  @staticmethod
138
138
  def set_recording(recording: bool) -> bool:
139
- cbool = ctypes.c_bool(recording)
140
- return bool(
141
- Library.framework().MaaSetGlobalOption(
142
- MaaOption(MaaGlobalOptionEnum.Recording),
143
- ctypes.pointer(cbool),
144
- ctypes.sizeof(ctypes.c_bool),
145
- )
146
- )
139
+ """
140
+ Deprecated
141
+ """
142
+ return False
147
143
 
148
144
  @staticmethod
149
145
  def set_stdout_level(level: LoggingLevelEnum) -> bool:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: MaaFw
3
- Version: 4.4.1
3
+ Version: 4.5.0b1
4
4
  Summary: An automation black-box testing framework based on image recognition
5
5
  Project-URL: Homepage, https://github.com/MaaXYZ/MaaFramework
6
6
  Author: MaaXYZ
@@ -83,8 +83,8 @@ _✨ 基于图像识别的自动化黑盒测试框架 ✨_
83
83
  - [MFATools](https://github.com/SweetSmellFox/MFATools) ![csharp](https://img.shields.io/badge/C%23-239120?logo=csharp&logoColor=white) ![license](https://img.shields.io/github/license/SweetSmellFox/MFATools) ![activity](https://img.shields.io/github/commit-activity/m/SweetSmellFox/MFATools?color=%23ff69b4) ![stars](https://img.shields.io/github/stars/SweetSmellFox/MFATools?style=social)
84
84
  基于WPF框架开发的工具界面,旨在提供类似于截图工具的功能
85
85
 
86
- - [YAMaaPE](https://github.com/kqcoxn/YAMaaPE) ![vue](https://img.shields.io/badge/vue-268923?logo=vue.js) ![js](https://img.shields.io/badge/Javascript-yellow?logo=Javascript) ![activity](https://img.shields.io/github/commit-activity/m/kqcoxn/YAMaaPE?color=%23ff69b4) ![stars](https://img.shields.io/github/stars/kqcoxn/YAMaaPE?style=social)
87
- 基于 vue-flow 的 Pipeline 编辑器。由 MaaFramework 强力驱动!
86
+ - [MaaPipelineEditor](https://github.com/kqcoxn/MaaPipelineEditor) ![Typescript](https://img.shields.io/badge/Typescript-8A2BE2?logo=typescript) ![activity](https://img.shields.io/github/commit-activity/m/kqcoxn/MaaPipelineEditor?color=%23ff69b4) ![stars](https://img.shields.io/github/stars/kqcoxn/MaaPipelineEditor?style=social)
87
+ 基于 react-flow 的 MaaFramework Pipeline 工作流式可视化编辑器,使用“无代码”流程图构建您的 Pipeline!
88
88
 
89
89
  ### 应用程序
90
90
 
@@ -0,0 +1,31 @@
1
+ maa/__init__.py,sha256=t2Z9yJWrSZfH16xYN67bKpiPEHDf7iaiw4wi0PjmU8U,250
2
+ maa/agent_client.py,sha256=qx1-3VGp97JB_UMlbkvK-O_GTigbdqD6U4gGKi2yQW4,4049
3
+ maa/buffer.py,sha256=XFr1MnWt-xmZkhQ_2ZzGfiqSJJwmphY4U07EEzMNYQc,16544
4
+ maa/context.py,sha256=dYCvRNqq2iCL8lIyp2TkZorGB5KNI34L3pGzlpdL7co,6454
5
+ maa/controller.py,sha256=pyVPwRnpGcGCoWAa2FOPBvwIY5jY2kqmRtd-V16bPyU,24507
6
+ maa/custom_action.py,sha256=honGd28UaKWzApYBHO9_Cka8hPfzZUy6HBUfIdfQiaU,2554
7
+ maa/custom_recognition.py,sha256=nfNgPKq9a6t2eoXwKMJRvZMXTh31Jn0JfxUMsfGI33Y,3384
8
+ maa/define.py,sha256=EHTbELEAf4vXuCLyNM6Xhp9MM6iigSA6b9QE3m-B3DE,13643
9
+ maa/job.py,sha256=MUI5T2X9ON9c7Dl6yo_0pp8Ulpn25XOD_uEdGm2k-TA,1231
10
+ maa/library.py,sha256=u6gbEHDV3I0y69-ZoBo1p6-bAtP4jqSQa4FICuzaw3U,3961
11
+ maa/notification_handler.py,sha256=LFJY6YqF9fJSkRsvpmj6ZL5DexMN_cEOj-HmpWpB9o0,5442
12
+ maa/resource.py,sha256=sCGAK1FFjZCaf01t_FPdtl4pMDQsybhEjmafp9XfITA,12222
13
+ maa/tasker.py,sha256=8eGK83RhsVXh1Px2_eHhUBd6epaubIGDN0FG4soi4xM,14232
14
+ maa/toolkit.py,sha256=H7P58dPLKzEm_aZMsDJ98IaMZnTE-hcFgK8MKnN0F6g,11381
15
+ maa/agent/__init__.py,sha256=K4vyyD6YgLR6PEQl86t4oKP4eViCdNr3Br94dNk8YjM,257
16
+ maa/agent/agent_server.py,sha256=e0yE_ffWJlTPydJbYLK9OhCM5fVVlZQIcvEQMjB5V68,3636
17
+ maa/bin/libMaaAdbControlUnit.dylib,sha256=YuFQ8uQW2hZy_Jf2Fohd46Xj3ifGwUpyrV_e_eqfsuU,741720
18
+ maa/bin/libMaaAgentClient.dylib,sha256=O_73k6mjnWBRh-5ZN5uRAMw0zZoC-hgMaPioKk5Eamk,1472608
19
+ maa/bin/libMaaAgentServer.dylib,sha256=yTFA3HeggH1niO61vzrCn0uE8kBRy2RZA9vp5QC5DUI,1626240
20
+ maa/bin/libMaaCustomControlUnit.dylib,sha256=dNMKTmsK1VhoIx7EwmTt5kBknbdYcTm6WCdATONiAV0,155624
21
+ maa/bin/libMaaDbgControlUnit.dylib,sha256=ubig1MwI9C22ILyaB8r207xFhcEV84_lfuqtWlPBQLk,339448
22
+ maa/bin/libMaaFramework.dylib,sha256=SoTR9qFeuJ95Vgzebh1lGxKlfbXLpVahj5QegaZ1Rpg,2862912
23
+ maa/bin/libMaaToolkit.dylib,sha256=B_p6_jlqoKxa1jVWjV95ZiM_g-UGQ2AZ5bFdRY4EX7o,1015464
24
+ maa/bin/libMaaUtils.dylib,sha256=fO5wmnKuIifnMlrOu76sSIAHYaIH4S1cfn52NqCpLO4,588272
25
+ maa/bin/libfastdeploy_ppocr.dylib,sha256=VMbQvnSnOiN3NBgEM-TH9dtbXt5St4yuSq9O7fEpY2I,5204496
26
+ maa/bin/libonnxruntime.1.19.2.dylib,sha256=Qy326NziiNoBiACOnXBuHPbl7F1-6iNHqX3yKpy2Df4,18829872
27
+ maa/bin/libopencv_world4.4.11.0.dylib,sha256=nGBbyApCQb2JIpMtyWa_oDNdaTMxx0ZDTNHlSALLFVc,13493432
28
+ maafw-4.5.0b1.dist-info/licenses/LICENSE.md,sha256=RG51X65V_wNLuyG-RGcLXxFsKyZnlH5wNvK_5mMlOag,7560
29
+ maafw-4.5.0b1.dist-info/METADATA,sha256=D48zivJj9YuhiZX3tkLp9oV8l4QXaJrgCOazofjygNM,24483
30
+ maafw-4.5.0b1.dist-info/WHEEL,sha256=uH4n7Su0XdKLw9IB_vCifAJxZvl_ChRwTrm1-ddvWvA,102
31
+ maafw-4.5.0b1.dist-info/RECORD,,
@@ -1,30 +0,0 @@
1
- maa/__init__.py,sha256=t2Z9yJWrSZfH16xYN67bKpiPEHDf7iaiw4wi0PjmU8U,250
2
- maa/agent_client.py,sha256=qx1-3VGp97JB_UMlbkvK-O_GTigbdqD6U4gGKi2yQW4,4049
3
- maa/buffer.py,sha256=XFr1MnWt-xmZkhQ_2ZzGfiqSJJwmphY4U07EEzMNYQc,16544
4
- maa/context.py,sha256=dYCvRNqq2iCL8lIyp2TkZorGB5KNI34L3pGzlpdL7co,6454
5
- maa/controller.py,sha256=V9ALn24vQX-mWngZbuapBcv-_HNHCtUwHXa3Em2X13s,22517
6
- maa/custom_action.py,sha256=honGd28UaKWzApYBHO9_Cka8hPfzZUy6HBUfIdfQiaU,2554
7
- maa/custom_recognition.py,sha256=nfNgPKq9a6t2eoXwKMJRvZMXTh31Jn0JfxUMsfGI33Y,3384
8
- maa/define.py,sha256=qec4GQkYi6AtorJ1ix880Fz67bpZULJOV3VpZEDd2Es,13341
9
- maa/job.py,sha256=MUI5T2X9ON9c7Dl6yo_0pp8Ulpn25XOD_uEdGm2k-TA,1231
10
- maa/library.py,sha256=u6gbEHDV3I0y69-ZoBo1p6-bAtP4jqSQa4FICuzaw3U,3961
11
- maa/notification_handler.py,sha256=LFJY6YqF9fJSkRsvpmj6ZL5DexMN_cEOj-HmpWpB9o0,5442
12
- maa/resource.py,sha256=sCGAK1FFjZCaf01t_FPdtl4pMDQsybhEjmafp9XfITA,12222
13
- maa/tasker.py,sha256=FDZwh9ai9Z-1hytRUFAiEwXGhruvHMCKPrbGSAOWxmY,14449
14
- maa/toolkit.py,sha256=H7P58dPLKzEm_aZMsDJ98IaMZnTE-hcFgK8MKnN0F6g,11381
15
- maa/agent/__init__.py,sha256=K4vyyD6YgLR6PEQl86t4oKP4eViCdNr3Br94dNk8YjM,257
16
- maa/agent/agent_server.py,sha256=e0yE_ffWJlTPydJbYLK9OhCM5fVVlZQIcvEQMjB5V68,3636
17
- maa/bin/libMaaAdbControlUnit.dylib,sha256=yyVtw53HC20OSuTrIQIXPOgf3JgfLpPlOpe70QY34aM,757128
18
- maa/bin/libMaaAgentClient.dylib,sha256=1znuu2By1_r3-EfLxPb2_uhbyaKA1VtRLL1i5s9Kcm4,1453688
19
- maa/bin/libMaaAgentServer.dylib,sha256=hsZkQSJ7oEten488SLYtJ942OCd2udfFYFopk_vFjGE,1725840
20
- maa/bin/libMaaDbgControlUnit.dylib,sha256=bC4Tse2ut47lykOFlkeAwF9wRoCttP_b5MCrA9fIgYA,329992
21
- maa/bin/libMaaFramework.dylib,sha256=ZpKCY5mWq0-P3mD4dXrEMaKlGFoxDVqGnOOAuq1uXs0,2879512
22
- maa/bin/libMaaToolkit.dylib,sha256=22kmml6aZHOuqNCd3ixEnaYgOcryaywj16orx7hA8Vs,973024
23
- maa/bin/libMaaUtils.dylib,sha256=n6tkpHX_5ULAS0uSuQieiAI0gzr-ovbONjGYS3cNfbA,541208
24
- maa/bin/libfastdeploy_ppocr.dylib,sha256=qQVfZuIKyeKCjzfcEWbuM5ZKegpv6YmOgsACd_8CIbM,5828304
25
- maa/bin/libonnxruntime.1.19.2.dylib,sha256=8ljJL__me6uJ46EopPFvyK0l2_ZbxtK-57EfSWO8ohg,19921160
26
- maa/bin/libopencv_world4.4.11.0.dylib,sha256=oxczEPffDVIxEnOVZ5aahIzqXuXwYDzffokxOxWjpw8,13909376
27
- maafw-4.4.1.dist-info/licenses/LICENSE.md,sha256=RG51X65V_wNLuyG-RGcLXxFsKyZnlH5wNvK_5mMlOag,7560
28
- maafw-4.4.1.dist-info/METADATA,sha256=EjAy1dUkGwkbs7Xe_VU9TqPLD0lBOp412sIct4XUd5g,24435
29
- maafw-4.4.1.dist-info/WHEEL,sha256=uH4n7Su0XdKLw9IB_vCifAJxZvl_ChRwTrm1-ddvWvA,102
30
- maafw-4.4.1.dist-info/RECORD,,
File without changes