Is there a way to link a HA switch to a keyboard key in windows?

id like to be able to turn on and off switchs just by pressing a macro on my board i use a 2nd keyboard with Auto Hot Keys to run macros to do things …
but id like to be able to pressing say F2 to turn On certain lights… F3 turn on this relay or what not
instead of loading up the website and toggling the switch… is there a way to do this?

i also use TPLink switchs and relays… as they worked out of the box and didnt need to desolder board like those costco tasmota switchs…
but is there a way to do this ? like to make it quicker… there is a kassa app for cell phone but wanted one for the keyboard so i can quickly hit a switch

I do not think that there is like a “built in” solution for this.
What you never the less can do (did not test myself but should work) is using webhooks triggering an automation and performing a request from your PC as soon as your short key is pressed.

See this for webhook details:

and install curl (included in WSL or as binary: curl for Windows)
Then link a local curl cmd to your keyboard macro (or simply create a shortcut like here: Open programs with keyboard shortcuts in Windows 10 - CNET)