UXP InDesign2025, onkeydown, up, etc. events are no longer being sent

As the title explains. I cannot receive keypress events on any element, including document, using addeventlistener.

Anyone know anything about this?

I have written code in Preact that uses onKeyDown, onInput, etc. for sp-textfield and it seems to work fine. What is your environment?

Environments that worked

  • InDesign 2025 (20.0.0.95)
  • macOS 12.7.5

Hey, thanks for taking the time :slight_smile:

I am running windows 11 on a new work laptop.
I am using UXP, and the change came after updating to indesign 2025.

I am not using spectrum, but vanilla html/css. The code is structured around bolt-uxp and react, but even outside the frameworks i cannot use the onkeydown :stuck_out_tongue:

My brain just thought, “what if i try in a different browser?”… I guess its still morning

Tried input tag just to be sure. onKeyPress does not respond, but onKeyDown and onKeyUp work. onKeyPress is deprecated, so this should not be a problem.

Is this difference due to OS, Preact or React, or some framework? I would like to know another person’s opinion.

<input
  type='text'
  value='a'
  onKeyDown={ (event) => {
    event.preventDefault() ;
    console.log(event) ;
  } }
/>