mirror of
https://github.com/valentderah/totk-pc-recomp.git
synced 2026-11-25 06:05:56 +00:00
Keep the gamepad unchanged under the direct mouse and the menu pointer, and fix the mouse activity flags
The camera input's activity hook wrote the flags to +0x418, but the game's next instruction stores w8 over them (1.4.3 main+0x874d80), so a mouse-only turn still read as idle. The hook now changes w8. The free-orbit hooks rewrote the camera stick input from the last sample even in steps without mouse motion; they now take a step only when the mouse moved in it or holds the pitch, so a gamepad-only step reaches the camera as the game made it. The mouse shake gesture for detaching parts is gone: three 24-count reversals fire while a held object is turned back and forth. Arrow keys or the pad's right stick shake as before. The menu pointer comes only while the keyboard and mouse are the device used last (input_kbm_last): a gamepad player sees the menus as on the console. Raw mouse travel is counted while the cursor is released too, so moving the mouse brings the pointer back. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8ff29be86f
commit
ff49f6b62f
9 files changed
+77
-95
No files matched your search
+3
-2
@@ -6,6 +6,9 @@
|
||||
// Down=15) and the stick directions (StickLLeft..Down 16-19, StickRLeft..Down 20-23, derived from the sticks).
|
||||
// Sticks are -32767..32767, up is +y. TOTK_INPUT=none reports no input. Callable from any thread.
|
||||
void input_poll(uint64_t *buttons, int32_t *lx, int32_t *ly, int32_t *rx, int32_t *ry);
|
||||
// 1 when keyboard and mouse are the device the player used last, 0 when the gamepad is: what is shown for pointing
|
||||
// (menu_cursor.c shows the pointer in the game's menus only for the keyboard and mouse)
|
||||
int input_kbm_last(void);
|
||||
// Direct mouse input is consumed by the game's camera-input update, after its stick response. While that update
|
||||
// accepts camera input, the HID right stick contains only the controller and keyboard. Selectors route mouse input
|
||||
// separately: a persistent radial cursor for the ability wheel, discrete steps for horizontal quick lists.
|
||||
@@ -17,8 +20,6 @@ void input_direct_mouse_radial(int32_t dx, int32_t dy, float sensitivity, float
|
||||
typedef struct { float distance; uint64_t pulse_until, neutral_until; int direction; } InputMouseRow;
|
||||
void input_direct_mouse_row(int32_t dx, float sensitivity, uint64_t now, InputMouseRow *row, int32_t out[2]);
|
||||
int input_direct_mouse_selector_active(void);
|
||||
// A deliberate mouse shake while manipulating an object feeds a short gesture to the game's native shake detector.
|
||||
int input_direct_mouse_shake(int allow, int32_t out[2]);
|
||||
// Consume direct mouse counts, including one-shot MOUSE events from an input script. enabled=0 discards scripted
|
||||
// counts while leaving the real mouse for menu input. Live counts require cursor capture and foreground focus.
|
||||
void input_direct_mouse_sample(int enabled, int32_t *dx, int32_t *dy);
|
||||
|
||||
Reference in new issue
Block a user