diff --git a/ahk/_async/engine.py b/ahk/_async/engine.py index ab0c068..01cff8d 100644 --- a/ahk/_async/engine.py +++ b/ahk/_async/engine.py @@ -1101,6 +1101,8 @@ async def key_state( if mode not in ('T', 'P'): raise ValueError(f'Invalid value for mode parameter. Mode must be `T` or `P`. Got {mode!r}') args.append(mode) + else: + args.append('') resp = await self._transport.function_call('AHKKeyState', args, blocking=blocking) return resp diff --git a/ahk/_sync/engine.py b/ahk/_sync/engine.py index 9e2df2d..bdfeb63 100644 --- a/ahk/_sync/engine.py +++ b/ahk/_sync/engine.py @@ -1089,6 +1089,8 @@ def key_state( if mode not in ('T', 'P'): raise ValueError(f'Invalid value for mode parameter. Mode must be `T` or `P`. Got {mode!r}') args.append(mode) + else: + args.append('') resp = self._transport.function_call('AHKKeyState', args, blocking=blocking) return resp