Keyboard and mouse for GTA 6 on console via Remote Play on PC

The method turns the keyboard and mouse into a virtual gamepad, so the game sees an ordinary controller.
Steps
On the console turn on Remote Play (PS5) or remote features (Xbox). On PS5 add the unofficial chiaki-ng program to Steam for free, turn on Steam Input and set up a profile: WASD drives the left stick, the mouse the right one, and the mouse buttons act as triggers. Always launch the program from Steam. On PS5 or Xbox you can also use the paid reWASD, which creates a virtual pad for the official app. If the system sees two controllers, unplug the physical pad.
Risks
The mouse imitates a stick, so aiming is less precise than on a regular PC. The stream adds latency, and a stable picture needs a connection of at least 15 Mb/s, preferably by cable. chiaki-ng is not an official Sony product. DS4Windows will not turn a pad into a keyboard.
Release-week data, unofficial, written in our own words. It may change after patches and Rockstar announcements.
Frequently asked questions
Does this work on PS5 and Xbox?
Yes, with different programs.
Is this an official method?
No, chiaki-ng is unofficial.