Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ game specific things:

# Changelog

### v1.11 (Upcoming)
- Added extra typing overloads to the `keybind` factory, to allow cases such as
`keybind("name", callback=func)`

### v1.10
- Added the `ObjectFlags` enum, holding a few known useful flags.

Expand Down
2 changes: 1 addition & 1 deletion __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from .dot_sdkmod import open_in_mod_dir

# Need to define a few things first to avoid circular imports
__version_info__: tuple[int, int] = (1, 10)
__version_info__: tuple[int, int] = (1, 11)
__version__: str = f"{__version_info__[0]}.{__version_info__[1]}"
__author__: str = "bl-sdk"

Expand Down
30 changes: 30 additions & 0 deletions keybinds.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,21 @@ def keybind(
) -> KeybindType: ...


@overload
def keybind(
identifier: str,
key: str | None = None,
*,
callback: KeybindCallback_NoArgs,
display_name: str | None = None,
description: str = "",
description_title: str | None = None,
is_hidden: bool = False,
is_rebindable: bool = True,
event_filter: EInputEvent = EInputEvent.IE_Pressed,
) -> KeybindType: ...


@overload
def keybind(
identifier: str,
Expand Down Expand Up @@ -173,6 +188,21 @@ def keybind(
) -> KeybindType: ...


@overload
def keybind(
identifier: str,
key: str | None = None,
*,
callback: KeybindCallback_Event,
display_name: str | None = None,
description: str = "",
description_title: str | None = None,
is_hidden: bool = False,
is_rebindable: bool = True,
event_filter: None,
) -> KeybindType: ...


@overload
def keybind(
identifier: str,
Expand Down