nx_x11_keyboard.nx
buildroot/runtime/nx_x11_keyboard.nx
about
nx_x11_keyboard.nx -- bits-up X11 keyboard input for the game platform (F1105).
X11 KeyPress events carry server-relative KEYCODES, not meanings; the meaning lives in the
server's keysym table. This lib fetches that table (GetKeyboardMapping, opcode 101), folds each
keycode's first keysym down to the BROWSER-STYLE virtual-key codes nx_input_abstract already
binds (WASD=87/65/83/68, arrows=37-40, space=32, enter=13...), and can inject synthetic key
events (SendEvent, opcode 25) so a selftest can drive the REAL server round-trip with no human.
GetKeyboardMapping request (8 bytes): [101][pad][len=2 u16][first_keycode][count][pad2]
Reply: 32-byte header (byte1 = keysyms_per_keycode, bytes 4-7 = data words) + u32 keysyms.
SendEvent request (44 bytes): [25][propagate][len=11 u16][destination u32][event_mask u32]
+ the 32-byte event. With event_mask=0 the server delivers to the client that CREATED the
destination window (us), flagged synthetic: event byte0 |= 0x80 -- dispatchers mask 0x7f.
license_tier: ORIGINAL
genealogy_id: international-research-sources/x_org/xproto_v11_r0
lineage_id: nishi_x11_keyboard_q10
dependencies 3 imports · 2 importers
imports: nx_syscalls.nxnx_x11_connect.nxnx_x11_window.nx
imported by: nx_desktop_game.nxnx_x11_keyboard_gate.nx
structs
| none |
consts
| 24 | const NX_X11_EVENT_KEY_RELEASE: i64 = 0x00000002 |
| 25 | const NX_X11_KEYMAP_N: i64 = 256 |
functions
| 29 | func nx_keysym_to_vk(ks: i64) -> i64 |
| 44 | func nx_x11_keymap_req(req: *u8, first: i64, count: i64) -> i64 |
| 58 | func nx_x11_load_keymap(conn: *X11Conn, vk_table: *i64) -> i64 |
| 105 | func nx_x11_send_key_req(req: *u8, root: i64, window: i64, keycode: i64, is_press: i64) -> i64 |
| 123 | func nx_x11_send_key(conn: *X11Conn, window: i64, keycode: i64, is_press: i64) -> i64 |
| 131 | func nx_x11_warp_pointer(conn: *X11Conn, window: i64, x: i64, y: i64) -> i64 |
| 145 | func nx_x11_send_motion(conn: *X11Conn, window: i64, x: i64, y: i64) -> i64 |
| 162 | func main() -> i64 |