"win32": the keyboard and the mouse from the window and the oldest
calls of the Windows API. Raw input needs Windows XP and DirectInput 8
needs DirectX 8; a build for Windows 95 or NT 4.0 had neither, so it
had the null input driver and could not be given a key.
- Keys. The window procedure sees every key go down and come up and
already turns each into a scancode for the key events it sends. It
tells this driver the same (win32_input_key_message(), one call
where the scancode is worked out): a bit a scancode. The window can
be the video thread's, so the bits are atomic words - set and
cleared there, loaded at the poll - and nothing is locked. The
frontend asks for the keys it has binds for once a poll
(keys_down), as it does of the other keyboard drivers.
- Its key map (rarch_key_map_win32) is DirectInput's in numbers:
scancodes, the extended keys with 0x80 added. No DirectX header.
- Mouse. Where the cursor is in the window at each poll, and its left,
right and middle buttons (GetAsyncKeyState(), the two swapped where
the user has them swapped), published for the frontend to answer the
mouse, the pointer and the lightgun from.
- Only while the window is the foreground one. Without it nothing is
down, and a key held when the window lost the foreground is not down
when it has it back.
What it does not have: a wheel, buttons four and five, motion past
the screen's edge (motion is how far the cursor went), a grab. And no
controllers - that is a joypad driver's, and the one for these
Windows, the multimedia library's joystick calls, is not written yet.
Built where HAVE_WIN32INPUT is defined (HAVE_WIN32INPUT=1), which
nothing turns on by default but the Visual C++ 6 project in the
commit after this. It is chosen by name, or where neither raw input
nor DirectInput is built or starts.
Run: the Windows build with it compiled in, under Wine, through the
scripted keyboard session - the core sees the same 63 lines with
"win32" as with "dinput", and DirectInput's own are the same as
before this. samples/input/win32_input runs the driver against a
real window under Wine: the key map both ways, keys down and up, an
extended key against the keypad key under it, the top bit of a word,
nothing down with another window in front, the mouse's place and
motion. Not run on a Windows machine, of any age.
Boot protocol HID keyboards on the Wii's USB ports type into the menu
and cores and drive the keyboard binds. os/gekko finds them among the
HID devices IOS lists, sets the boot protocol and turns their reports
into connect, key and disconnect events; the gx input driver turns
those into key events and key state, US layout for characters. The
HID pad driver leaves keyboards awake. The USB HID usage key map is
shared with the Wii U as rarch_key_map_hid.
Add keyboard overlay preset, keyboard submenu, and osk_toggle hotkey. Use overlay caching for osk_toggle.
For now, keyboard menu has only preset path, auto-scale toggle, and opacity.
Related fixes:
- input_keyboard_event: Don't check hotkey binds when device is RETRO_DEVICE_POINTER
- Add input_keymaps_translate_rk_to_ascii() for correct character input to input_keyboard_event
- input_overlay_poll: Delay clearing INPUT_OVERLAY_BLOCKED flag until there is no overlay input (Avoids stray input after osk_toggle)
- Send keyboard events for modifiers before other keys (for correct modifier+key input if hitboxes overlap)