mirror of
https://github.com/valentderah/totk-pc-recomp.git
synced 2026-11-12 18:31:05 +00:00
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>
21 lines
1.4 KiB
C
21 lines
1.4 KiB
C
// Between input.c (gamepad, merging, scripts) and the keyboard and mouse of the window system's back end (input_win.c
|
|
// with Win32, input_sdl.c with SDL). Any thread.
|
|
#pragma once
|
|
#include <stdint.h>
|
|
|
|
// ---- what the back end provides
|
|
int ikb_foreground(void); // the game window is in front: keys count
|
|
int ikb_down(int key); // key id (input_map.h KEY_*) held, mouse buttons included
|
|
int ikb_escape(void); // Esc held (no key id: it belongs to the menu)
|
|
// The pointer in the client area, 0..1 from its top left; 0 when the window is not in front or the pointer is outside
|
|
int ikb_pointer(float *nx, float *ny);
|
|
void ikb_pointer_set(float nx, float ny); // moves the pointer there (the window in front only)
|
|
int ikb_captured(void); // the cursor is captured for the mouse camera
|
|
void ikb_mouse_take(int32_t *dx, int32_t *dy); // raw mouse motion since the last call, in counts
|
|
uint32_t ikb_mouse_travel(void); // raw counts the mouse moved in total (|dx| + |dy|), captured or not
|
|
void ikb_cursor_update(void); // what input_cursor_allowed says may have changed
|
|
void ikb_menu_closed(void); // the menu closed: a capture that Esc gave up comes back
|
|
|
|
// ---- what input.c provides the back end
|
|
int input_cursor_allowed(void); // no text entry or menu open, the mouse camera on, input not disabled
|