@@ -1125,12 +1125,32 @@ async def set_capslock_state(
1125
1125
resp = await self ._transport .function_call ('AHKSetCapsLockState' , args , blocking = blocking )
1126
1126
return resp
1127
1127
1128
+ # fmt: off
1129
+ @overload
1130
+ async def set_volume (self , value : int , device_number : int = 1 ) -> None : ...
1131
+ @overload
1132
+ async def set_volume (self , value : int , device_number : int = 1 , * , blocking : Literal [False ]) -> AsyncFutureResult [None ]: ...
1133
+ @overload
1134
+ async def set_volume (self , value : int , device_number : int = 1 , * , blocking : Literal [True ]) -> None : ...
1135
+ @overload
1136
+ async def set_volume (self , value : int , device_number : int = 1 , * , blocking : bool = True ) -> Union [None , AsyncFutureResult [None ]]: ...
1137
+ # fmt: on
1128
1138
async def set_volume (
1129
- self , value : int , device_number : int = 1 , blocking : bool = True
1139
+ self , value : int , device_number : int = 1 , * , blocking : bool = True
1130
1140
) -> Union [None , AsyncFutureResult [None ]]:
1131
1141
args = [str (device_number ), str (value )]
1132
1142
return await self ._transport .function_call ('AHKSetVolume' , args , blocking = blocking )
1133
1143
1144
+ # fmt: off
1145
+ @overload
1146
+ async def show_traytip (self , title : str , text : str , second : float = 1.0 , type_id : int = 1 , * , silent : bool = False , large_icon : bool = False ) -> None : ...
1147
+ @overload
1148
+ async def show_traytip (self , title : str , text : str , second : float = 1.0 , type_id : int = 1 , * , silent : bool = False , large_icon : bool = False , blocking : Literal [False ]) -> AsyncFutureResult [None ]: ...
1149
+ @overload
1150
+ async def show_traytip (self , title : str , text : str , second : float = 1.0 , type_id : int = 1 , * , silent : bool = False , large_icon : bool = False , blocking : Literal [True ]) -> None : ...
1151
+ @overload
1152
+ async def show_traytip (self , title : str , text : str , second : float = 1.0 , type_id : int = 1 , * , silent : bool = False , large_icon : bool = False , blocking : bool = True ) -> Union [None , AsyncFutureResult [None ]]: ...
1153
+ # fmt: on
1134
1154
async def show_traytip (
1135
1155
self ,
1136
1156
title : str ,
@@ -1146,6 +1166,16 @@ async def show_traytip(
1146
1166
args = [title , text , str (second ), str (option )]
1147
1167
return await self ._transport .function_call ('AHKTrayTip' , args , blocking = blocking )
1148
1168
1169
+ # fmt: off
1170
+ @overload
1171
+ async def show_error_traytip (self , title : str , text : str , second : float = 1.0 , * , silent : bool = False , large_icon : bool = False ) -> None : ...
1172
+ @overload
1173
+ async def show_error_traytip (self , title : str , text : str , second : float = 1.0 , * , silent : bool = False , large_icon : bool = False , blocking : Literal [False ]) -> AsyncFutureResult [None ]: ...
1174
+ @overload
1175
+ async def show_error_traytip (self , title : str , text : str , second : float = 1.0 , * , silent : bool = False , large_icon : bool = False , blocking : Literal [True ]) -> None : ...
1176
+ @overload
1177
+ async def show_error_traytip (self , title : str , text : str , second : float = 1.0 , * , silent : bool = False , large_icon : bool = False , blocking : bool = True ) -> Union [None , AsyncFutureResult [None ]]: ...
1178
+ # fmt: on
1149
1179
async def show_error_traytip (
1150
1180
self ,
1151
1181
title : str ,
@@ -1160,6 +1190,16 @@ async def show_error_traytip(
1160
1190
title = title , text = text , second = second , type_id = 3 , silent = silent , large_icon = large_icon , blocking = blocking
1161
1191
)
1162
1192
1193
+ # fmt: off
1194
+ @overload
1195
+ async def show_info_traytip (self , title : str , text : str , second : float = 1.0 , * , silent : bool = False , large_icon : bool = False ) -> None : ...
1196
+ @overload
1197
+ async def show_info_traytip (self , title : str , text : str , second : float = 1.0 , * , silent : bool = False , large_icon : bool = False , blocking : Literal [False ]) -> AsyncFutureResult [None ]: ...
1198
+ @overload
1199
+ async def show_info_traytip (self , title : str , text : str , second : float = 1.0 , * , silent : bool = False , large_icon : bool = False , blocking : Literal [True ]) -> None : ...
1200
+ @overload
1201
+ async def show_info_traytip (self , title : str , text : str , second : float = 1.0 , * , silent : bool = False , large_icon : bool = False , blocking : bool = True ) -> Union [None , AsyncFutureResult [None ]]: ...
1202
+ # fmt: on
1163
1203
async def show_info_traytip (
1164
1204
self ,
1165
1205
title : str ,
@@ -1174,6 +1214,16 @@ async def show_info_traytip(
1174
1214
title = title , text = text , second = second , type_id = 1 , silent = silent , large_icon = large_icon , blocking = blocking
1175
1215
)
1176
1216
1217
+ # fmt: off
1218
+ @overload
1219
+ async def show_warning_traytip (self , title : str , text : str , second : float = 1.0 , * , silent : bool = False , large_icon : bool = False ) -> None : ...
1220
+ @overload
1221
+ async def show_warning_traytip (self , title : str , text : str , second : float = 1.0 , * , silent : bool = False , large_icon : bool = False , blocking : Literal [False ]) -> AsyncFutureResult [None ]: ...
1222
+ @overload
1223
+ async def show_warning_traytip (self , title : str , text : str , second : float = 1.0 , * , silent : bool = False , large_icon : bool = False , blocking : Literal [True ]) -> None : ...
1224
+ @overload
1225
+ async def show_warning_traytip (self , title : str , text : str , second : float = 1.0 , * , silent : bool = False , large_icon : bool = False , blocking : bool = True ) -> Union [None , AsyncFutureResult [None ]]: ...
1226
+ # fmt: on
1177
1227
async def show_warning_traytip (
1178
1228
self ,
1179
1229
title : str ,
@@ -1194,8 +1244,6 @@ async def show_tooltip(
1194
1244
x : Optional [int ] = None ,
1195
1245
y : Optional [int ] = None ,
1196
1246
which : int = 1 ,
1197
- * ,
1198
- blocking : bool = True ,
1199
1247
) -> None :
1200
1248
if which not in range (1 , 21 ):
1201
1249
raise ValueError ('which must be an integer between 1 and 20' )
@@ -1208,29 +1256,60 @@ async def show_tooltip(
1208
1256
args .append (str (y ))
1209
1257
else :
1210
1258
args .append ('' )
1211
- await self ._transport .function_call ('AHKShowToolTip' , args , blocking = blocking )
1259
+ await self ._transport .function_call ('AHKShowToolTip' , args )
1212
1260
1213
1261
async def hide_tooltip (self , which : int = 1 ) -> None :
1214
1262
await self .show_tooltip (which = which )
1215
1263
1264
+ # fmt: off
1265
+ @overload
1266
+ async def sound_beep (self , frequency : int = 523 , duration : int = 150 ) -> None : ...
1267
+ @overload
1268
+ async def sound_beep (self , frequency : int = 523 , duration : int = 150 , * , blocking : Literal [False ]) -> AsyncFutureResult [None ]: ...
1269
+ @overload
1270
+ async def sound_beep (self , frequency : int = 523 , duration : int = 150 , * , blocking : Literal [True ]) -> None : ...
1271
+ @overload
1272
+ async def sound_beep (self , frequency : int = 523 , duration : int = 150 , * , blocking : bool = True ) -> Optional [AsyncFutureResult [None ]]: ...
1273
+ # fmt: on
1216
1274
async def sound_beep (
1217
1275
self , frequency : int = 523 , duration : int = 150 , * , blocking : bool = True
1218
1276
) -> Optional [AsyncFutureResult [None ]]:
1219
1277
args = [str (frequency ), str (duration )]
1220
1278
await self ._transport .function_call ('AHKSoundBeep' , args , blocking = blocking )
1221
1279
return None
1222
1280
1281
+ # fmt: off
1282
+ @overload
1283
+ async def sound_get (self , device_number : int = 1 , component_type : str = 'MASTER' , control_type : str = 'VOLUME' ) -> str : ...
1284
+ @overload
1285
+ async def sound_get (self , device_number : int = 1 , component_type : str = 'MASTER' , control_type : str = 'VOLUME' , * , blocking : Literal [False ]) -> AsyncFutureResult [str ]: ...
1286
+ @overload
1287
+ async def sound_get (self , device_number : int = 1 , component_type : str = 'MASTER' , control_type : str = 'VOLUME' , * , blocking : Literal [True ]) -> str : ...
1288
+ @overload
1289
+ async def sound_get (self , device_number : int = 1 , component_type : str = 'MASTER' , control_type : str = 'VOLUME' , * , blocking : bool = True ) -> Union [str , AsyncFutureResult [str ]]: ...
1290
+ # fmt: on
1223
1291
async def sound_get (
1224
1292
self ,
1225
1293
device_number : int = 1 ,
1226
1294
component_type : str = 'MASTER' ,
1227
1295
control_type : str = 'VOLUME' ,
1296
+ * ,
1228
1297
blocking : bool = True ,
1229
1298
) -> Union [str , AsyncFutureResult [str ]]:
1230
1299
args = [str (device_number ), component_type , control_type ]
1231
1300
return await self ._transport .function_call ('AHKSoundGet' , args , blocking = blocking )
1232
1301
1233
- async def sound_play (self , filename : str , blocking : bool = True ) -> Union [None , AsyncFutureResult [None ]]:
1302
+ # fmt: off
1303
+ @overload
1304
+ async def sound_play (self , filename : str ) -> None : ...
1305
+ @overload
1306
+ async def sound_play (self , filename : str , * , blocking : Literal [False ]) -> AsyncFutureResult [None ]: ...
1307
+ @overload
1308
+ async def sound_play (self , filename : str , * , blocking : Literal [True ]) -> None : ...
1309
+ @overload
1310
+ async def sound_play (self , filename : str , * , blocking : bool = True ) -> Union [None , AsyncFutureResult [None ]]: ...
1311
+ # fmt: on
1312
+ async def sound_play (self , filename : str , * , blocking : bool = True ) -> Union [None , AsyncFutureResult [None ]]:
1234
1313
return await self ._transport .function_call ('AHKSoundPlay' , [filename ], blocking = blocking )
1235
1314
1236
1315
async def sound_set (
@@ -1239,6 +1318,7 @@ async def sound_set(
1239
1318
device_number : int = 1 ,
1240
1319
component_type : str = 'MASTER' ,
1241
1320
control_type : str = 'VOLUME' ,
1321
+ * ,
1242
1322
blocking : bool = True ,
1243
1323
) -> Union [None , AsyncFutureResult [None ]]:
1244
1324
args = [str (device_number ), component_type , control_type , str (value )]
@@ -2648,6 +2728,16 @@ async def win_restore(
2648
2728
resp = await self ._transport .function_call ('AHKWinRestore' , args , engine = self , blocking = blocking )
2649
2729
return resp
2650
2730
2731
+ # fmt: off
2732
+ @overload
2733
+ async def win_wait (self , title : str = '' , text : str = '' , exclude_title : str = '' , exclude_text : str = '' , * , title_match_mode : Optional [TitleMatchMode ] = None , detect_hidden_windows : Optional [bool ] = None , timeout : Optional [int ] = None ) -> AsyncWindow : ...
2734
+ @overload
2735
+ async def win_wait (self , title : str = '' , text : str = '' , exclude_title : str = '' , exclude_text : str = '' , * , title_match_mode : Optional [TitleMatchMode ] = None , detect_hidden_windows : Optional [bool ] = None , timeout : Optional [int ] = None , blocking : Literal [False ]) -> AsyncFutureResult [AsyncWindow ]: ...
2736
+ @overload
2737
+ async def win_wait (self , title : str = '' , text : str = '' , exclude_title : str = '' , exclude_text : str = '' , * , title_match_mode : Optional [TitleMatchMode ] = None , detect_hidden_windows : Optional [bool ] = None , timeout : Optional [int ] = None , blocking : Literal [True ]) -> AsyncWindow : ...
2738
+ @overload
2739
+ async def win_wait (self , title : str = '' , text : str = '' , exclude_title : str = '' , exclude_text : str = '' , * , title_match_mode : Optional [TitleMatchMode ] = None , detect_hidden_windows : Optional [bool ] = None , timeout : Optional [int ] = None , blocking : bool = True ) -> Union [AsyncWindow , AsyncFutureResult [AsyncWindow ]]: ...
2740
+ # fmt: on
2651
2741
async def win_wait (
2652
2742
self ,
2653
2743
title : str = '' ,
@@ -2672,6 +2762,16 @@ async def win_wait(
2672
2762
resp = await self ._transport .function_call ('AHKWinWait' , args , blocking = blocking , engine = self )
2673
2763
return resp
2674
2764
2765
+ # fmt: off
2766
+ @overload
2767
+ async def win_wait_active (self , title : str = '' , text : str = '' , exclude_title : str = '' , exclude_text : str = '' , * , title_match_mode : Optional [TitleMatchMode ] = None , detect_hidden_windows : Optional [bool ] = None , timeout : Optional [int ] = None ) -> AsyncWindow : ...
2768
+ @overload
2769
+ async def win_wait_active (self , title : str = '' , text : str = '' , exclude_title : str = '' , exclude_text : str = '' , * , title_match_mode : Optional [TitleMatchMode ] = None , detect_hidden_windows : Optional [bool ] = None , timeout : Optional [int ] = None , blocking : Literal [False ]) -> AsyncFutureResult [AsyncWindow ]: ...
2770
+ @overload
2771
+ async def win_wait_active (self , title : str = '' , text : str = '' , exclude_title : str = '' , exclude_text : str = '' , * , title_match_mode : Optional [TitleMatchMode ] = None , detect_hidden_windows : Optional [bool ] = None , timeout : Optional [int ] = None , blocking : Literal [True ]) -> AsyncWindow : ...
2772
+ @overload
2773
+ async def win_wait_active (self , title : str = '' , text : str = '' , exclude_title : str = '' , exclude_text : str = '' , * , title_match_mode : Optional [TitleMatchMode ] = None , detect_hidden_windows : Optional [bool ] = None , timeout : Optional [int ] = None , blocking : bool = True ) -> Union [AsyncWindow , AsyncFutureResult [AsyncWindow ]]: ...
2774
+ # fmt: on
2675
2775
async def win_wait_active (
2676
2776
self ,
2677
2777
title : str = '' ,
@@ -2696,6 +2796,16 @@ async def win_wait_active(
2696
2796
resp = await self ._transport .function_call ('AHKWinWaitActive' , args , blocking = blocking , engine = self )
2697
2797
return resp
2698
2798
2799
+ # fmt: off
2800
+ @overload
2801
+ async def win_wait_not_active (self , title : str = '' , text : str = '' , exclude_title : str = '' , exclude_text : str = '' , * , title_match_mode : Optional [TitleMatchMode ] = None , detect_hidden_windows : Optional [bool ] = None , timeout : Optional [int ] = None ) -> AsyncWindow : ...
2802
+ @overload
2803
+ async def win_wait_not_active (self , title : str = '' , text : str = '' , exclude_title : str = '' , exclude_text : str = '' , * , title_match_mode : Optional [TitleMatchMode ] = None , detect_hidden_windows : Optional [bool ] = None , timeout : Optional [int ] = None , blocking : Literal [False ]) -> AsyncFutureResult [AsyncWindow ]: ...
2804
+ @overload
2805
+ async def win_wait_not_active (self , title : str = '' , text : str = '' , exclude_title : str = '' , exclude_text : str = '' , * , title_match_mode : Optional [TitleMatchMode ] = None , detect_hidden_windows : Optional [bool ] = None , timeout : Optional [int ] = None , blocking : Literal [True ]) -> AsyncWindow : ...
2806
+ @overload
2807
+ async def win_wait_not_active (self , title : str = '' , text : str = '' , exclude_title : str = '' , exclude_text : str = '' , * , title_match_mode : Optional [TitleMatchMode ] = None , detect_hidden_windows : Optional [bool ] = None , timeout : Optional [int ] = None , blocking : bool = True ) -> Union [AsyncWindow , AsyncFutureResult [AsyncWindow ]]: ...
2808
+ # fmt: on
2699
2809
async def win_wait_not_active (
2700
2810
self ,
2701
2811
title : str = '' ,
@@ -2856,6 +2966,16 @@ async def win_move(
2856
2966
resp = await self ._transport .function_call ('AHKWinMove' , args , blocking = blocking )
2857
2967
return resp
2858
2968
2969
+ # fmt: off
2970
+ @overload
2971
+ async def get_clipboard (self ) -> str : ...
2972
+ @overload
2973
+ async def get_clipboard (self , * , blocking : Literal [False ]) -> AsyncFutureResult [str ]: ...
2974
+ @overload
2975
+ async def get_clipboard (self , * , blocking : Literal [True ]) -> str : ...
2976
+ @overload
2977
+ async def get_clipboard (self , * , blocking : bool = True ) -> Union [str , AsyncFutureResult [str ]]: ...
2978
+ # fmt: on
2859
2979
async def get_clipboard (self , * , blocking : bool = True ) -> Union [str , AsyncFutureResult [str ]]:
2860
2980
return await self ._transport .function_call ('AHKGetClipboard' , blocking = blocking )
2861
2981
@@ -2866,6 +2986,16 @@ async def set_clipboard(self, s: str, *, blocking: bool = True) -> Union[None, A
2866
2986
async def get_clipboard_all (self , * , blocking : bool = True ) -> Union [bytes , AsyncFutureResult [bytes ]]:
2867
2987
return await self ._transport .function_call ('AHKGetClipboardAll' , blocking = blocking )
2868
2988
2989
+ # fmt: off
2990
+ @overload
2991
+ async def set_clipboard_all (self , contents : bytes ) -> None : ...
2992
+ @overload
2993
+ async def set_clipboard_all (self , contents : bytes , * , blocking : Literal [False ]) -> AsyncFutureResult [None ]: ...
2994
+ @overload
2995
+ async def set_clipboard_all (self , contents : bytes , * , blocking : Literal [True ]) -> None : ...
2996
+ @overload
2997
+ async def set_clipboard_all (self , contents : bytes , * , blocking : bool = True ) -> Union [None , AsyncFutureResult [None ]]: ...
2998
+ # fmt: on
2869
2999
async def set_clipboard_all (
2870
3000
self , contents : bytes , * , blocking : bool = True
2871
3001
) -> Union [None , AsyncFutureResult [None ]]:
@@ -2892,6 +3022,16 @@ def on_clipboard_change(
2892
3022
) -> None :
2893
3023
self ._transport .on_clipboard_change (callback , ex_handler )
2894
3024
3025
+ # fmt: off
3026
+ @overload
3027
+ async def clip_wait (self , timeout : Optional [float ] = None , wait_for_any_data : bool = False ) -> None : ...
3028
+ @overload
3029
+ async def clip_wait (self , timeout : Optional [float ] = None , wait_for_any_data : bool = False , * , blocking : Literal [False ]) -> AsyncFutureResult [None ]: ...
3030
+ @overload
3031
+ async def clip_wait (self , timeout : Optional [float ] = None , wait_for_any_data : bool = False , * , blocking : Literal [True ]) -> None : ...
3032
+ @overload
3033
+ async def clip_wait (self , timeout : Optional [float ] = None , wait_for_any_data : bool = False , * , blocking : bool = True ) -> Union [None , AsyncFutureResult [None ]]: ...
3034
+ # fmt: on
2895
3035
async def clip_wait (
2896
3036
self , timeout : Optional [float ] = None , wait_for_any_data : bool = False , * , blocking : bool = True
2897
3037
) -> Union [None , AsyncFutureResult [None ]]:
@@ -2907,12 +3047,32 @@ async def block_input(
2907
3047
) -> None :
2908
3048
await self ._transport .function_call ('AHKBlockInput' , args = [value ])
2909
3049
3050
+ # fmt: off
3051
+ @overload
3052
+ async def reg_delete (self , key_name : str , value_name : Optional [str ] = None ) -> None : ...
3053
+ @overload
3054
+ async def reg_delete (self , key_name : str , value_name : Optional [str ] = None , * , blocking : Literal [False ]) -> Union [None , AsyncFutureResult [None ]]: ...
3055
+ @overload
3056
+ async def reg_delete (self , key_name : str , value_name : Optional [str ] = None , * , blocking : Literal [True ]) -> None : ...
3057
+ @overload
3058
+ async def reg_delete (self , key_name : str , value_name : Optional [str ] = None , * , blocking : bool = True ) -> Union [None , AsyncFutureResult [None ]]: ...
3059
+ # fmt: on
2910
3060
async def reg_delete (
2911
3061
self , key_name : str , value_name : Optional [str ] = None , * , blocking : bool = True
2912
3062
) -> Union [None , AsyncFutureResult [None ]]:
2913
3063
args = [key_name , value_name if value_name is not None else '' ]
2914
3064
return await self ._transport .function_call ('AHKRegDelete' , args , blocking = blocking )
2915
3065
3066
+ # fmt: off
3067
+ @overload
3068
+ async def reg_write (self , value_type : Literal ['REG_SZ' , 'REG_EXPAND_SZ' , 'REG_MULTI_SZ' , 'REG_DWORD' , 'REG_BINARY' ], key_name : str , value_name : Optional [str ] = None , value : Optional [str ] = None ) -> None : ...
3069
+ @overload
3070
+ async def reg_write (self , value_type : Literal ['REG_SZ' , 'REG_EXPAND_SZ' , 'REG_MULTI_SZ' , 'REG_DWORD' , 'REG_BINARY' ], key_name : str , value_name : Optional [str ] = None , value : Optional [str ] = None , * , blocking : Literal [False ]) -> AsyncFutureResult [None ]: ...
3071
+ @overload
3072
+ async def reg_write (self , value_type : Literal ['REG_SZ' , 'REG_EXPAND_SZ' , 'REG_MULTI_SZ' , 'REG_DWORD' , 'REG_BINARY' ], key_name : str , value_name : Optional [str ] = None , value : Optional [str ] = None , * , blocking : Literal [True ]) -> None : ...
3073
+ @overload
3074
+ async def reg_write (self , value_type : Literal ['REG_SZ' , 'REG_EXPAND_SZ' , 'REG_MULTI_SZ' , 'REG_DWORD' , 'REG_BINARY' ], key_name : str , value_name : Optional [str ] = None , value : Optional [str ] = None , * , blocking : bool = True ) -> Union [None , AsyncFutureResult [None ]]: ...
3075
+ # fmt: on
2916
3076
async def reg_write (
2917
3077
self ,
2918
3078
value_type : Literal ['REG_SZ' , 'REG_EXPAND_SZ' , 'REG_MULTI_SZ' , 'REG_DWORD' , 'REG_BINARY' ],
@@ -2931,6 +3091,16 @@ async def reg_write(
2931
3091
args .append (value )
2932
3092
return await self ._transport .function_call ('AHKRegWrite' , args , blocking = blocking )
2933
3093
3094
+ # fmt: off
3095
+ @overload
3096
+ async def reg_read (self , key_name : str , value_name : Optional [str ] = None ) -> str : ...
3097
+ @overload
3098
+ async def reg_read (self , key_name : str , value_name : Optional [str ] = None , * , blocking : Literal [False ]) -> AsyncFutureResult [str ]: ...
3099
+ @overload
3100
+ async def reg_read (self , key_name : str , value_name : Optional [str ] = None , * , blocking : Literal [True ]) -> str : ...
3101
+ @overload
3102
+ async def reg_read (self , key_name : str , value_name : Optional [str ] = None , * , blocking : bool = True ) -> Union [str , AsyncFutureResult [str ]]: ...
3103
+ # fmt: on
2934
3104
async def reg_read (
2935
3105
self , key_name : str , value_name : Optional [str ] = None , * , blocking : bool = True
2936
3106
) -> Union [str , AsyncFutureResult [str ]]:
0 commit comments