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

cmd+c/cmd+v not working in webview (MacOs) #18

Closed
rorywalsh opened this issue Aug 2, 2023 · 6 comments
Closed

cmd+c/cmd+v not working in webview (MacOs) #18

rorywalsh opened this issue Aug 2, 2023 · 6 comments

Comments

@rorywalsh
Copy link

Default keybindings for copy/paste/cut don't seem to work with the webview on MacOS. As a test you can add a simple <input type="text"> to your page. The same test works fine on Windows. Is there something special that needs to be done to enable this behaviour? I'll dig through the source to see if something obvious jumps out, perhaps it's a known issue?

@cannc4
Copy link

cannc4 commented Aug 8, 2023

Been having the same problem too.
I think there are ways to catch the events and use clipboard helpers like writeText to handle clipboard events but obviously would be great if it was directly supported

@rorywalsh
Copy link
Author

In my use case I was able to get around the issue by intercepted the key presses on the js side and passing them on to the relevant components, but it's not ideal. I keep my fingers crossed that there is a simple solution thst can be implemented on the choc::webview side. Until now this has been the only real issue I've faced with it.

@julianstorer
Copy link
Collaborator

Thanks - we'll be doing some plugin compatibility work fairly soon, and this is one of the things we'll be checking

@otristan
Copy link

Would be eager to get this supported so
I'm trying to add this but I'm no objC expert
From what I understand
you need to add
class_addMethod (webviewClass, sel_registerName ("performKeyEquivalent:"),
in WebviewClass() ctor

and do something similar to
https://stackoverflow.com/questions/970707/cocoa-keyboard-shortcuts-in-dialog-without-an-edit-menu

Any input is welcomed

Thanks !

@julianstorer
Copy link
Collaborator

OK, I've pushed a fix for this now - give it a try!

@otristan
Copy link

Works fine now. Thanks a lot !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants