Skip to content

Commit daec531

Browse files
committed
renames
1 parent 473d7e8 commit daec531

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1616

1717
- Fixed issue with pop_screen launched from an action https://github.com/Textualize/textual/pull/4657
1818

19+
### Changed
20+
21+
- `App.check_bindings` is now private
22+
- `App.action_check_bindings` is now `App.action_simulate_key`
23+
1924
## [0.68.0] - 2024-06-14
2025

2126
### Added

src/textual/app.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2985,9 +2985,9 @@ def simulate_key(self, key: str) -> None:
29852985
Args:
29862986
key: Key to simulate. May also be the name of a key, e.g. "space".
29872987
"""
2988-
self.call_later(self.check_bindings, key)
2988+
self.call_later(self._check_bindings, key)
29892989

2990-
async def check_bindings(self, key: str, priority: bool = False) -> bool:
2990+
async def _check_bindings(self, key: str, priority: bool = False) -> bool:
29912991
"""Handle a key press.
29922992
29932993
This method is used internally by the bindings system.
@@ -3058,7 +3058,7 @@ async def on_event(self, event: events.Event) -> None:
30583058
self.screen._clear_tooltip()
30593059
except NoScreen:
30603060
pass
3061-
if not await self.check_bindings(event.key, priority=True):
3061+
if not await self._check_bindings(event.key, priority=True):
30623062
forward_target = self.focused or self.screen
30633063
forward_target._forward_event(event)
30643064
else:
@@ -3240,7 +3240,7 @@ async def _on_layout(self, message: messages.Layout) -> None:
32403240
message.stop()
32413241

32423242
async def _on_key(self, event: events.Key) -> None:
3243-
if not (await self.check_bindings(event.key)):
3243+
if not (await self._check_bindings(event.key)):
32443244
await self.dispatch_key(event)
32453245

32463246
async def _on_shutdown_request(self, event: events.ShutdownRequest) -> None:
@@ -3471,14 +3471,13 @@ def _watch_app_focus(self, focus: bool) -> None:
34713471
# Remove focus for now.
34723472
self.screen.set_focus(None)
34733473

3474-
async def action_check_bindings(self, key: str) -> None:
3474+
async def action_simulate_ky(self, key: str) -> None:
34753475
"""An [action](/guide/actions) to handle a key press using the binding system.
34763476
34773477
Args:
34783478
key: The key to process.
34793479
"""
3480-
if not await self.check_bindings(key, priority=True):
3481-
await self.check_bindings(key, priority=False)
3480+
self.simulate_key(key)
34823481

34833482
async def action_quit(self) -> None:
34843483
"""An [action](/guide/actions) to quit the app as soon as possible."""

src/textual/widgets/_classic_footer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def _make_key_text(self) -> Text:
137137
),
138138
meta=(
139139
{
140-
"@click": f"app.check_bindings('{binding.key}')",
140+
"@click": f"app.simulate_key('{binding.key}')",
141141
"key": binding.key,
142142
}
143143
if enabled and app_focus

0 commit comments

Comments
 (0)