on my keyboard the '?' didn't work. In bearlibterminal I use
char tk_char = terminal_state(TK_CHAR);
to read the character and then compare tkchar == '?' for example, I had issues with these too.
Thanks. Unfortunately, this won't be a quick fix for me because the game is already rigged up to use a table that links the key codes to command functions. It might be easier for me just to start switching to SDL3 since it appears to me that it also has key codes that are tied with the actual character.