# Real input path: mouse in the main menu (NSEvents -> DirectInput mouse
# state, GetCursorPos and WM_* mouse messages), then keys held in a race
# while the app loses focus (AppKit's resign-active handler): every key the
# game holds is released (DirectInput key-up events, WM_KEYUP), nothing
# sticks after focus comes back (on the web a key still down comes back with
# its next autorepeat: kb_focus_regain), and a key released while Command is
# held still reaches the game.
# @in+0x2d4 throttle, @in+0x2c8 steer (+ = left); [0x874c48] keyboard
# channel action mask (active low).
0     nstapuntil RETURN MC_Background.fng 120 4000
+200  nstap RETURN                                  # "create a profile?" -> No
+0    waitfng GarageMain.fng 3000
+400  dump mm_before_click
+0    nsmouse move 0.842 0.257                      # scroller: right arrow
+20   nsmouse down L
+8    nsmouse up L
+200  dump mm_after_arrow_click
+0    nsmouse scroll -3
+20   nsmouse scroll 3
+20   nsmouse move 0.783 0.964                      # "Quit Game"
+20   nsmouse down L
+8    nsmouse up L
+200  dump mm_after_quit_click
+0    nstap ESCAPE                                  # "Cancel"
+200  dump mm_after_escape
+0    nsmouse move 0.158 0.257                      # scroller: left arrow, back to Quick Race
+20   nsmouse down L
+8    nsmouse up L
+200  nstapuntil RETURN UI_QRModeSelect.fng 150 3000
+200  nstapuntil RETURN UI_QRTrackSelect.fng 150 1500
+200  nstapuntil RETURN UI_QRModeOptions.fng 150 1500
+200  nstapuntil RETURN UI_QRCarSelect.fng 150 1500
+200  nstapuntil RETURN PC_Loading.fng 150 1500
+0    waitmem 0x8654a4 6 3000
+700  dump race_go
+0    log --- hold Up (throttle) and Left ---
+0    nsdown UP
+0    nsdown LEFT
+240  peek @in+0x2d4
+0    peek @in+0x2c8
+0    peek 0x874c48
+0    dump holding
+0    log --- focus lost while both keys are held ---
+0    nsfocus out
+10   peek @in+0x2d4
+0    peek @in+0x2c8
+0    peek 0x874c48
+180  dump after_focus_loss
+0    nsfocus in
+180  log --- focus back, the keys are still physically down but nothing is held ---
+0    peek @in+0x2d4
+0    peek @in+0x2c8
+0    peek 0x874c48
+0    dump after_focus_back
+0    nsup UP                                       # their late key-ups change nothing
+0    nsup LEFT
+30   log --- W held, Command pressed, W repeats and is released with Command down ---
+0    nsdown W
+60   peek @in+0x2d4
+0    nsdown LCMD
+4    nsrepeat W 2                                  # its autorepeats now carry Command: swallowed
+10   nsup W
+20   peek @in+0x2d4
+0    peek 0x874c48
+0    nsup LCMD
+30   log --- Up works again ---
+0    nsdown UP
+60   peek @in+0x2d4
+0    nsup UP
+30   peek @in+0x2d4
+60   quit
