INNER CODE UNIT · Python
_get_window_extension_method
spyoungtech/ahk · ahk/_async/engine.py:181
def _get_window_extension_method(self, name: str) -> Callable[..., Any] | None:
is_async = False
is_async = True # unasync: remove
if is_async:
if name in self._method_registry.async_window_methods:
method = self._method_registry.async_window_methods[name]
return method
else:
if name in self._method_registry.sync_window_methods:
method = self._method_registry.sync_window_methods[name]
return method
return None
def add_hotkey(
self, keyname: str, callback: Callable[[], Any], ex_handler: Optional[Callable[[str, Exception], Any]] = None
) -> None:
"""
Register a function to be called when a hotkey is pressed.