Full input-surface audit of the PC keyboard channel. The arcade abort was the typed ampersand character (0x26), but the Win32 port feeds WM_KEYUP VIRTUAL-KEY codes into the same channel - and VK_UP is also 0x26. The hat look-up key aborted the mission: that was every mystery abort across the multiplayer test rounds. Likewise the E key (0x45, the right pedal!) dumped the event queue on every release. Disarmed: plain 0x26 and E are swallowed at the L4 layer; the abort answers only to the deliberate Alt+Q chord (translated to the legacy engine code, so APP.cpp is untouched); the debug toggles (wireframe Alt+W, predator vision Alt+V, frame dump Alt+F, perf stats, event queue on Alt+E now) arm only with RP412DEVKEYS=1. The cheat-string manager has no PC-keyboard strings and the trace-log keys are compiled out of release - both inert. Verified live: a volley of VK_UP releases mid-race leaves the mission running; Alt+Q aborts on demand. Docs and the dist README updated. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
141 lines
4.9 KiB
C
141 lines
4.9 KiB
C
#pragma once
|
|
|
|
#include "..\munga\style.h"
|
|
|
|
#define VK_MASK 0x00FF
|
|
#define CTRL_BIT 0x0100
|
|
#define ALT_BIT 0x0200
|
|
//
|
|
//----------------------------------------------------------------
|
|
// Handy keycode definitions
|
|
//----------------------------------------------------------------
|
|
//
|
|
# define PCK_ESC VK_ESCAPE // "escape" key
|
|
# define PCK_ENTER VK_RETURN // the ever-popular "enter" key
|
|
# define PCK_TAB VK_TAB // the obvious "tab" key
|
|
//
|
|
//----------------------------------------------------------------
|
|
// Extended keycodes: function keys
|
|
//----------------------------------------------------------------
|
|
//
|
|
# define PCK_F1 VK_F1
|
|
# define PCK_F2 VK_F2
|
|
# define PCK_F3 VK_F3
|
|
# define PCK_F4 VK_F4
|
|
# define PCK_F5 VK_F5
|
|
# define PCK_F6 VK_F6
|
|
# define PCK_F7 VK_F7
|
|
# define PCK_F8 VK_F8
|
|
# define PCK_F9 VK_F9
|
|
# define PCK_F10 VK_F10
|
|
# define PCK_F11 VK_F11
|
|
# define PCK_F12 VK_F12
|
|
//
|
|
//----------------------------------------------------------------
|
|
// Extended keycodes: ctrl-function keys
|
|
//----------------------------------------------------------------
|
|
//
|
|
# define PCK_CTL_F1 (CTRL_BIT | VK_F1)
|
|
# define PCK_CTL_F2 (CTRL_BIT | VK_F2)
|
|
# define PCK_CTL_F3 (CTRL_BIT | VK_F3)
|
|
# define PCK_CTL_F4 (CTRL_BIT | VK_F4)
|
|
# define PCK_CTL_F5 (CTRL_BIT | VK_F5)
|
|
# define PCK_CTL_F6 (CTRL_BIT | VK_F6)
|
|
# define PCK_CTL_F7 (CTRL_BIT | VK_F7)
|
|
# define PCK_CTL_F8 (CTRL_BIT | VK_F8)
|
|
# define PCK_CTL_F9 (CTRL_BIT | VK_F9)
|
|
# define PCK_CTL_F10 (CTRL_BIT | VK_F10)
|
|
# define PCK_CTL_F11 (CTRL_BIT | VK_F11)
|
|
# define PCK_CTL_F12 (CTRL_BIT | VK_F12)
|
|
//
|
|
//----------------------------------------------------------------
|
|
// Extended keycodes: alt-function keys
|
|
//----------------------------------------------------------------
|
|
//
|
|
# define PCK_ALT_F1 (ALT_BIT | VK_F1)
|
|
# define PCK_ALT_F2 (ALT_BIT | VK_F2)
|
|
# define PCK_ALT_F3 (ALT_BIT | VK_F3)
|
|
# define PCK_ALT_F4 (ALT_BIT | VK_F4)
|
|
# define PCK_ALT_F5 (ALT_BIT | VK_F5)
|
|
# define PCK_ALT_F6 (ALT_BIT | VK_F6)
|
|
# define PCK_ALT_F7 (ALT_BIT | VK_F7)
|
|
# define PCK_ALT_F8 (ALT_BIT | VK_F8)
|
|
# define PCK_ALT_F9 (ALT_BIT | VK_F9)
|
|
# define PCK_ALT_F10 (ALT_BIT | VK_F10)
|
|
# define PCK_ALT_F11 (ALT_BIT | VK_F11)
|
|
# define PCK_ALT_F12 (ALT_BIT | VK_F12)
|
|
//
|
|
//----------------------------------------------------------------
|
|
// Extended keycodes: cursor keys (numeric keypad WITH NUMLOCK OFF!)
|
|
//----------------------------------------------------------------
|
|
//
|
|
# define PCK_INS VK_INSERT
|
|
# define PCK_DEL VK_DELETE
|
|
# define PCK_HOME VK_HOME
|
|
# define PCK_UP VK_UP
|
|
# define PCK_PGUP VK_PRIOR
|
|
# define PCK_LEFT VK_LEFT
|
|
# define PCK_RIGHT VK_RIGHT
|
|
# define PCK_END VK_END
|
|
# define PCK_DOWN VK_DOWN
|
|
# define PCK_PGDN VK_NEXT
|
|
//
|
|
//----------------------------------------------------------------
|
|
// Extended keycodes: ctrl-cursor keys
|
|
//----------------------------------------------------------------
|
|
//
|
|
# define PCK_CTL_INS (CTRL_BIT | VK_INSERT)
|
|
# define PCK_CTL_DEL (CTRL_BIT | VK_DELETE)
|
|
# define PCK_CTL_HOME (CTRL_BIT | VK_HOME)
|
|
# define PCK_CTL_UP (CTRL_BIT | VK_UP)
|
|
# define PCK_CTL_PGUP (CTRL_BIT | VK_PRIOR)
|
|
# define PCK_CTL_LEFT (CTRL_BIT | VK_LEFT)
|
|
# define PCK_CTL_RIGHT (CTRL_BIT | VK_RIGHT)
|
|
# define PCK_CTL_END (CTRL_BIT | VK_END)
|
|
# define PCK_CTL_DOWN (CTRL_BIT | VK_DOWN)
|
|
# define PCK_CTL_PGDN (CTRL_BIT | VK_NEXT)
|
|
//
|
|
//----------------------------------------------------------------
|
|
// Extended keycodes: alt-cursor keys
|
|
//----------------------------------------------------------------
|
|
//
|
|
# define PCK_ALT_INS (ALT_BIT | VK_INSERT)
|
|
# define PCK_ALT_DEL (ALT_BIT | VK_DELETE)
|
|
# define PCK_ALT_HOME (ALT_BIT | VK_HOME)
|
|
# define PCK_ALT_UP (ALT_BIT | VK_UP)
|
|
# define PCK_ALT_PGUP (ALT_BIT | VK_PRIOR)
|
|
# define PCK_ALT_LEFT (ALT_BIT | VK_LEFT)
|
|
# define PCK_ALT_RIGHT (ALT_BIT | VK_RIGHT)
|
|
# define PCK_ALT_END (ALT_BIT | VK_END)
|
|
# define PCK_ALT_DOWN (ALT_BIT | VK_DOWN)
|
|
# define PCK_ALT_PGDN (ALT_BIT | VK_NEXT)
|
|
//
|
|
//----------------------------------------------------------------
|
|
// Extended keycodes: alt-keys
|
|
//----------------------------------------------------------------
|
|
//
|
|
# define PCK_ALT_W (ALT_BIT | 'W')
|
|
# define PCK_ALT_R (ALT_BIT | 'R')
|
|
# define PCK_ALT_P (ALT_BIT | 'P')
|
|
# define PCK_ALT_F (ALT_BIT | 'F')
|
|
# define PCK_ALT_K (ALT_BIT | 'K')
|
|
# define PCK_ALT_V (ALT_BIT | 'V')
|
|
# define PCK_ALT_E (ALT_BIT | 'E')
|
|
# define PCK_ALT_Q (ALT_BIT | 'Q')
|
|
# define PCK_ALT_SLASH (ALT_BIT | VK_OEM_2) // '/?' key
|
|
|
|
//
|
|
//----------------------------------------------------------------
|
|
// Extended keycodes: ctrl-keys
|
|
//----------------------------------------------------------------
|
|
//
|
|
# define PCK_CTRL_W (CTRL_BIT | 'W')
|
|
# define PCK_CTRL_R (CTRL_BIT | 'R')
|
|
# define PCK_CTRL_P (CTRL_BIT | 'P')
|
|
# define PCK_CTRL_F (CTRL_BIT | 'F')
|
|
# define PCK_CTRL_K (CTRL_BIT | 'K')
|
|
# define PCK_CTRL_V (CTRL_BIT | 'V')
|
|
# define PCK_CTRL_SLASH (CTRL_BIT | VK_OEM_2) // '/?' key
|
|
|
|
extern int PC_Keyboard_Read(void); // returns code or zero if no key
|