Interception tools!
https://gitlab.com/interception/linux/toolsWith the official caps2esc plugin! https://gitlab.com/interception/linux/plugins/caps2esc
I use the stock caps2esc config; capsock by itself is Escape, but press with another key and it's control. Many other options are possible and writing your own plugin is not hard if nothing else suits. Interception-tools is amazing.
Interception-tools is also one of the most interestingly unix like tools out there, using pipes to break apart & pipeline it's tasks. Incredible power, but also kind of dauntint to really understand! Thankfully you can just copy paste the configs in & it works fine. But archwiki is a good write-up if you want to go deeper on this epic tool. https://wiki.archlinux.org/title/interception-tools
Setting up interception-tools as a systemd user service with a Nice=-10 is a good early lesson on improving your world with modern Linux tools. Highly highly highly recommend. I cannot work without.