/* * hack.web.c: the keyboard of Hack 1.0.3 in the browser (fredygames.com). Hack reads keys with getchar() * (config.h turns that into cw_hack_getchar); the page delivers them through curses-web/curses.c. The arrow * keys arrive as h j k l (Hack has no keypad mode), Enter as '\n', Backspace as ^H. * Copyright (C) 2026 FredyGames. Distributed under the MIT License (see curses-web/LICENSE). */ #include #include "curses.h" int cw_hack_getchar(void) { int c = cw_getkey(-1); if (c == ERR) return EOF; return c & 0xff; }