Mouse events not working?

747 views
Skip to first unread message

terry...@yahoo.com

unread,
Mar 18, 2011, 1:35:26 PM3/18/11
to delphichromiumembedded
Using 195, browser comp works ok. But if using with google maps, I
can't drag the map with the mouse. Using this same basic test HTML
page in a chrome browser works fine.

Anything to watch out for? Bugs? Events that need defined?

j-v

unread,
Mar 20, 2011, 11:03:22 AM3/20/11
to delphichromiumembedded
guiclient from the latest trunk works good for me, I tried google maps
and in particular -- mouse events worked fine, including right-clicks,
dragging, and the wheel.
Try http://code.google.com/p/delphichromiumembedded/source/checkout

terry...@yahoo.com

unread,
Mar 21, 2011, 3:54:43 PM3/21/11
to delphichromiumembedded
Found out that doing the following test page works using chrome
browser...but does *not* work in CEF test client, or my code. The map
shows in CEF, but the left mouse click event does not fire....nor does
mouse panning work either. The right click event does fire correctly,
however? Not sure why the "click" listener is not working?

Now...if I don't use this test page, but I use the map page on googles
main site...it DOES work? There must be something that's off here?
Anyone have a workaround?

<!DOCTYPE html>
<html><head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" /
>
<style type="text/css">
html { height: 100% }
body { height: 100%; margin: 0px; padding: 0px }
#map_canvas { height: 100% }
</style>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?
sensor=false"></script>
<script type="text/javascript">
function initialize() {
var latlng = new google.maps.LatLng(-34.397, 150.644);
var myOptions = {
zoom: 8,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new
google.maps.Map(document.getElementById("map_canvas"),
myOptions);

google.maps.event.addListener(map, 'rightclick', rightclick_handler);
google.maps.event.addListener(map, 'click', click_handler);
}
function rightclick_handler(event)
{
alert('Right click!');
}
function click_handler(event)
{
alert('Mouse click!');
}

</script>
</head>
<body onload="initialize()">
<div id="map_canvas" style="width:100%; height:100%"></div>
</body></html>

terry...@yahoo.com

unread,
Mar 22, 2011, 9:29:52 AM3/22/11
to delphichromiumembedded
Ok...found out the problem...the google maps API is thinking that my
CEF browser is a mobile device?? It is switching to gesture mode, and
so the mouse click stuff is partially disabled. Interesting?

Apparently, the main google maps page does some more extensive testing
of the browser and correctly figures out that CEF is a desktop
browser....and thus the mouse stuff works. However, the simple API
examples do not correctly identify the browser type.

I guess I'll try to mess around with the user agent strings or the
maps API and force the maps to a desktop state.....

Thanks!


On Mar 21, 2:54 pm, "terryfr...@yahoo.com" <terryfr...@yahoo.com>
wrote:

rklomp

unread,
Apr 8, 2011, 4:43:53 AM4/8/11
to delphichromiumembedded
I have the same problem. Dragging works ok using Google maps v2 api's,
but not when you use v3 api's. Also searched the cef site and this
issue is also reported there: http://code.google.com/p/chromiumembedded/issues/detail?id=134

So seems to be a 'cromium embedded' problem and not a 'delphi
chromium' problem.

jep

unread,
May 5, 2011, 11:24:44 AM5/5/11
to delphichromiumembedded
Anyone made ANY kind of progress on this? I've tried some of the same
routes, trying to figure out how to get Google to stop sending me the
crappy version. No luck.

Only thing I've found to work is r78 of the plugin, which does indeed
still work properly with google maps. However, it's so old that the
Delphi wrapper is totally useless without some major heavy lifting
that I'm not really knowledgeable enough to do.

Plus, that's not really an idea solution, anyway. But it might be
nice to get past this bug until they can fix it in the current version
of the plugin, since this is definitely a showstopper for me.
Reply all
Reply to author
Forward
0 new messages