As a halfway workaround, you can set up keycode 224 (brightness down) or 225 (up) to the e02b keyscan:
sudo setkeycodes e02b 225.
Both F2 and F3 will set up a monitor brighter, so there is also need set up keyboard driver to differ them.
I am also have an HP computer:
System: Host: pavilion15dk0ur Kernel: 5.15.0-46-generic x86_64 bits: 64 compiler: N/A Desktop: Gnome 3.36.9 wm: gnome-shell
dm: GDM3 Distro: Ubuntu 20.04.5 LTS (Focal Fossa)
Machine: Type: Laptop System: HP product: HP Pavilion Gaming Laptop...