NOTE WELL: Not actively maintained! I wrote this in 2010 to create a key map for use in console on my laptop and haven't really touched it since. I no longer have any way of testing changes.
kbdscan sets the FreeBSD console keyboard in mode where it shows
codes of keys pressed and released. These codes can then be used for
defining a keymap for the keyboard in the FreeBSD console. See
kbdmap(5) and kbdcontrol(1).
Five seconds of inactivity resets the console to the original mode and quits the program.
Note that kbdscan will only work if it is run directly in the FreeBSD console.
kbdscan is available in FreeBSD ports as misc/kbdscan. I would
have placed it in sysutils myself, but I'm not the maintainer of the
port.
https://codeberg.org/mchack/kbdscan
There are some FreeBSD console keymaps (along with X11 and Linux equivalents) here: