Copy/Paste support on Mac in Offscreen Rendering Mode

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Copy/Paste support on Mac in Offscreen Rendering Mode

Postby nigoyal » Fri Nov 07, 2014 6:48 am

I wonder if somebody is able to get Copy/Paste working using Command-C/Command-V on Mac using the Offscreen rendering mode.
I tried by creating CefKeyEvent having the modifier
keyEvent.modifiers |= EVENTFLAG_COMMAND_DOWN

when command key is pressed but am unable to get Copy/Paste working. In fact Command-a to select all is also not working.

Any suggestion if i need to pass any other modifier when generating the CefKeyEvent ?

Thanks
nigoyal
Newbie
 
Posts: 5
Joined: Fri Nov 07, 2014 6:40 am

Re: Copy/Paste support on Mac in Offscreen Rendering Mode

Postby magreenblatt » Fri Nov 07, 2014 11:33 am

You need to handle the commands in your application and call browser->GetFocusedFrame()->Copy(), etc.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Copy/Paste support on Mac in Offscreen Rendering Mode

Postby nigoyal » Mon Nov 10, 2014 6:12 am

Thanks a lot!. I was able to get it working using the information you provided.
Saved me a lot of time.

Thanks
nigoyal
Newbie
 
Posts: 5
Joined: Fri Nov 07, 2014 6:40 am

Re: Copy/Paste support on Mac in Offscreen Rendering Mode

Postby callum » Wed Sep 02, 2015 6:42 pm

that works for me too - in other similar APIs I've used, you can determine if there is something available to copy or if paste is valid - useful for enabling the option to copy or paste on a right-click menu say - anything like that in CEF?
callum
Expert
 
Posts: 326
Joined: Mon Feb 23, 2015 6:19 pm

Re: Copy/Paste support on Mac in Offscreen Rendering Mode

Postby magreenblatt » Thu Sep 03, 2015 4:52 am

callum wrote:that works for me too - in other similar APIs I've used, you can determine if there is something available to copy or if paste is valid - useful for enabling the option to copy or paste on a right-click menu say - anything like that in CEF?

For context menus this information is available via the CefContextMenuParams argument to CefContextMenuHandler::OnBeforeContextMenu.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Copy/Paste support on Mac in Offscreen Rendering Mode

Postby callum » Thu Sep 03, 2015 11:31 am

Got it - thanks.
callum
Expert
 
Posts: 326
Joined: Mon Feb 23, 2015 6:19 pm


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 34 guests