Skip to main content

Event when pressing a button on the keyboard

  • December 19, 2022
  • 1 reply
  • 50 views

Forum|alt.badge.img+2

Hello!
Is it possible to assign an event to any button on the keyboard in Miro? I am trying to use the following code:

alert("1");

document.addEventListener('keydown', funсKey);

function funсKey() {
  alert("2");
}

The first alert displays "1", but the second one does not work when you press the button on the keyboard. I tried to do this by replacing "keydown" with "click", but it didn't work either.

Was it helpful?

1 reply

William Bishop
Mironeer
Forum|alt.badge.img+4

Hey @Anton Shherbinin,

Thanks for reaching out about this!

At the moment, I don’t believe we have native support within the SDK itself for the keydown method. Have you considered leveraging the notifications method in our SDK for presenting alerts to end users? Maybe this could help:
https://developers.miro.com/docs/notifications_notifications 

Will


Reply