druid icon indicating copy to clipboard operation
druid copied to clipboard

`Ctrl+V` clipboard paste in HTML5

Open sashkent3 opened this issue 3 months ago • 1 comments

I would like to use the commonly used Ctrl+V hotkey for a clipboard paste action in an HTML5 game. This turns out to be quite difficult because of the security constraints around access to the clipboard on the web.

One of the following options would help me a lot:

  1. Add set_web_user_interaction to hotkey component, such that a Ctrl+V hotkey could access clipboard.
  2. Add hotkey support to button.set_key_trigger, such that I could trigger a druid:new_button(...):set_web_user_interaction(true) with a Ctrl+V, not only a single key.
  3. Ability to trigger the button in code, such that a hotkey component could trigger a button with .set_web_user_interaction(true) setup.

Do any of the above features fit into Druid? What are the potential pitfalls?

sashkent3 avatar Sep 10 '25 10:09 sashkent3

Hello! From all of this options seems first, to add the same web interaction to the hotkey the best

From pitfalls need to understand is it can grab all modifier buttons correctly and also check if the Macos will work good (AFAIK the command button is not tracked in the browser, but not sure)

Insality avatar Sep 10 '25 12:09 Insality