Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling preventDefault on keypress events suppresses browser clipboard events #1829

Closed
vladbat00 opened this issue Jan 17, 2021 · 3 comments
Closed
Labels

Comments

@vladbat00
Copy link

event.prevent_default();

This particular line of code prevents browsers to send clipboard events if winit's canvas is focused.

That makes it troublesome to add copy/cut/paste events support to UI frameworks.

@maroider
Copy link
Member

maroider commented Feb 7, 2021

I believe this problem has already been brought up in #1768, but copy/cut/paste wasn't explicitly called out there.

@vladbat00 vladbat00 changed the title Calling preventDefault on keypress events suppressed browser clipboard events Calling preventDefault on keypress events suppresses browser clipboard events Jan 23, 2022
@daxpedda
Copy link
Member

daxpedda commented Jun 2, 2023

You can now use WindowBuilder::with_prevent_default(false).

Though ultimately this should also be solved by #2156 or #2831.

I researched this briefly, as far as I can tell you can change clipboard keybinds, so we could also expose an option to not use preventDefault() when we detect the clipboard keybinds.

@daxpedda
Copy link
Member

daxpedda commented Jun 2, 2023

Closing in favor of #2831, which might be extended to handle certain things like that.

@daxpedda daxpedda closed this as not planned Won't fix, can't repro, duplicate, stale Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants