GTA 6 with keyboard and mouse on PS5 and Xbox: does it work and how to get around it

A keyboard plugged into the console works only in the system menu.
Status
Rockstar has not announced such a feature, and the game menu has no settings for these devices. A PC version could provide it natively, but there is no date.
Workarounds
chiaki-ng on PC (free): an open Remote Play client, and you assign the mouse to the right stick through Steam Input. PS Remote Play with reWASD (paid from 12.99 EUR, 7-day trial): creates a virtual controller, and Sony recommends at least 15 Mb/s. On Xbox similarly through the Xbox app with reWASD.
XIM and Cronus Zen
Adapters plugged between the console and the controller. XIM is for playing with a keyboard and mouse, while Cronus Zen also runs scripts (macros, recoil reduction), which is cheating. Rockstar has not issued a separate statement, and the general GTA Online terms apply. Since November 2023 Xbox blocks unauthorized accessories, and it is unclear whether this covers these adapters. In offline story mode nobody is harmed, but an update can disable the adapter, and in online modes the risk applies to your account.
Release-week data, unofficial. It may change after patches and Rockstar announcements.
Frequently asked questions
Does GTA 6 support a mouse on PS5?
No.