Let Tab reach the game in the Game tab (#261)
The game did get Tab, but the editor moved the keyboard focus to a button at the same time. The next Space then pressed that button instead of reaching the game. The key field of On key down could not capture Tab at all, so an inventory on Tab could not be built. - FocusManager asks tabBelongsElsewhere before it moves the focus. The editor answers yes while the Game tab is in front, so Tab stays with the game as long as no field has the focus. - A widget can claim Tab through takesTab. The key capture button does so while it is capturing, so On key down accepts Tab. - The harness knows the key Tab. Found on the way: - The first version of check 20g left the Behavior tab in front, and module 21 then failed in the chained run. 20g now goes back. Tests: - ./check.sh: 2746 tests, CHECK EXIT 0. - e2e 20 has two new checks: Tab reaches the game and leaves the keyboard with it, the key field captures Tab. Both failed against the old bundle. - GM_STEPS=19,20: all passed, 44 checks. The full local run with all three topics of this push passed with 1543 checks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d2701b3ec5
commit
d7d0a6e7d4
6 files changed
+52
-2
No files matched your search
@@ -460,6 +460,10 @@ export class Editor implements PlayHost {
|
||||
const onTick = (ticker: Ticker) => this.tick(ticker.deltaMS / 1000);
|
||||
app.ticker.add(onTick);
|
||||
this.cleanups.push(() => app.ticker.remove(onTick));
|
||||
// In the game view Tab is a game key (an inventory, a target switch) – like every other key there.
|
||||
const focus = ui().focus;
|
||||
focus.tabBelongsElsewhere = () => this.tab === 'game';
|
||||
this.cleanups.push(() => (focus.tabBelongsElsewhere = () => false));
|
||||
// A node, a frame and a template object exist only in their own document, so selecting one
|
||||
// brings it up. Selecting an asset never does: that is what opening it (double-click, Enter,
|
||||
// creating it) is for – see the `open` event below.
|
||||
|
||||
Reference in new issue
Block a user