Commit 8f70c3b
Fix transition toolbar buttons via synthetic keyboard events
postMessage (for WCP command files) is async so the FocusItem message
races with the iframe blur event, causing transition_next/prev WCP
commands to execute before Surfer's focused-variable state is restored.
Switch transition_next/prev to dispatch synthetic ArrowRight/ArrowLeft
keydown events directly to the Surfer iframe canvas (same-origin).
This mirrors pressing the arrow keys while the iframe is focused
(known working path) and avoids the async fetch race entirely.
FocusItem is still re-sent 50 ms before the key event so ordering
is guaranteed.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 0a5742c commit 8f70c3b
1 file changed
Lines changed: 30 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
123 | 146 | | |
| 147 | + | |
124 | 148 | | |
125 | 149 | | |
126 | 150 | | |
| |||
0 commit comments