How to detect a keystroke on the keyboard.?

Hi,

Great question!

You can trigger functions and events on keypress using Velo or writing your own custom code.

In Velo, you can trigger an event using the KeyboardEvent, there is more info about it here: KeyboardEvent - Velo API Reference - Wix.com

You can also add custom code to any page of your site or the entire site, you can read about it here: Embedding Custom Code on Your Site | Help Center | Wix.com

Here is an example code:

<script>
document.addEventListener("keydown", event => {
  if (event.isComposing || event.keyCode === 83) {
    console.log("this is awesome!");
  }
});
</script>

The specific keycodes can be found here: https://keycode.info/

We don’t recommend using this method as we can’t troubleshot issue with third party code.