0

Fire Mouse Event Programatically to an X-Y location

asked 2017-04-12 12:50:05 +0800

ansancle gravatar image ansancle
327 9

I need to fire a left mouse click event at a specific location on the screen from either my server or in the client in zscript or javascript.

delete flag offensive retag edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2017-04-17 02:35:19 +0800

cor3000 gravatar image cor3000
6280 2 7

updated 2017-04-17 02:38:13 +0800

Hello Ansancle,

according to this stack overflow the browser API already has such built in functionality.

Here a zkfiddle showing how to trigger the event to the component below a certain coordinate.

Note: triggering events from server side Java code will result in untrusted events (depending on the browser) having less privileges to perform certain actions. https://developer.mozilla.org/en/docs/Web/API/Event/isTrusted

Still I am not sure this e exactly what you were asking for. If questions remain please provide additional details.

Robert

link publish delete flag offensive edit

Comments

This look like exactly what I needed, thanks!!

ansancle ( 2017-04-17 13:05:46 +0800 )edit

you're welcome

cor3000 ( 2017-04-18 02:27:59 +0800 )edit
-1

answered 2017-04-16 08:15:29 +0800

Darksu gravatar image Darksu
1991 1 4

Hello ansancle,

You can start by checking out the following component:

https://www.zkoss.org/wiki/ZKComponentReference/Essential_Components/Imagemap

Else you could use javascript as shown at the following forum post:

http://forum.zkoss.org/question/21645/how-to-get-the-current-location-x-y-of-mouse-cursor/

Best,

Darksu

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
2 followers

RSS

Stats

Asked: 2017-04-12 12:50:05 +0800

Seen: 28 times

Last updated: Apr 17 '17

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More