Files
totk-pc-recomp/runtime/input_wsys.h
T
Wellington Dias 1d51343ac1 Build and run the runtime natively on Linux.
Shared runtime code now goes through runtime/platform/platform.h, implemented by platform/win32.c and a new
platform/linux.c: futex locks, a userfaultfd and PAGEMAP_SCAN write watch, signal-based async preemption, our own
fiber switch, and a SIGSEGV handler for the thaw and crash hooks. The window, input, menu and software keyboard get
SDL3 back ends beside the Win32 ones, with the swapchain (gfx_present.c) and input merging (input.c) shared. SHA-256
replaces BCrypt, ELF builds get their own override sections, and the build tools gain Linux branches.

On Linux the selftest and the gfx-abi, astc, nvn and window probes pass. probe-vkmem still fails: imported guest
memory cannot be write-watched on Linux, which the shadow buffers in vk_memory.c will address.
2026-10-29 16:56:56 -03:00

17 lines
1.1 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)
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
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