Skip to content

Commit

Permalink
fix key_state for AHKv2 when no mode argument is given
Browse files Browse the repository at this point in the history
  • Loading branch information
spyoungtech committed Apr 3, 2024
1 parent 0ef89ef commit fc95d07
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ahk/_async/engine.py
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions ahk/_sync/engine.py
Expand Up @@ -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

Expand Down

0 comments on commit fc95d07

Please sign in to comment.