Can JS detect when a key is down, like the command modifier @keydown

Can a javascript function detect when a key is down, like the command modifier @keydown

I've used the sort folder tabs script
here...
and updated it to be able to sort by tab name or folder and tab name

I'd like to be able to press the control key when clicking the icon
to control whether the folder is included in the sort

Standard opus functions can use the command modifier @keydown to
detect whether a particular key is down.

Is there a javascript command (and VBS) that will allow that to be done ?

The OnClick method receives a ClickData object, which has a func property which returns a Func object, which has a qualifiers property, which returns a string indicating any qualifier keys that were held down when the command was invoked.