Questions tagged [dispatchevent]

170 questions
5
votes
0 answers

Re-dispatch KeyboardEvent

Working on an Angular / TypeScript app, where we have a custom basic text editor. Trying to appropriately handle when a user has a highlighted selection and then hits a key, intending to replace the selection. To handle this, we need to properly…
Eric R
  • 673
  • 2
  • 9
  • 15
5
votes
2 answers

PhantomJS cannot click on existing elements

I use PhantomJS 1.9.7 on windows 8.1 and I am going to click on Login button after typing username and password. I can write username and password but, when I want PhantomJS to click on the button, It can find the element but is not able of clicking…
4
votes
1 answer

Itemrenderer Dispatch Custom Event

I'm trying to dispatch a custom event from a custom ItemRenderer This is my custom event package events { import customClass.Product; import flash.events.Event; public class CopyProductEvent extends Event { public static…
Marcx
  • 6,806
  • 5
  • 46
  • 69
4
votes
2 answers

javascript - dispatchEvent return true but not working in Chrome

There are some web,I type the code below not working.For example,I type the code in console at Bing(a search engine) var event; event = document.createEvent('Event'); event.initEvent("keypress", true, true); event.view = window; event.keyCode =…
Ivan Wu
  • 191
  • 1
  • 10
4
votes
2 answers

Dispatch an event if any error is occurred in Joomla

Is there any way to dispatch an event and call a method when an error is occurred in joomla same as Zend ? I want to log those error in log file. I want to use a single method to catch every error. is it possible ? Is there any other way to do this…
4
votes
3 answers

Simulating mouse events in Actionscript 3

Given stage coordinates (x,y), I want to make my flash app behave just as if the user clicked at position (x,y). That is, something like function simulateClick(x:Number, y:Number):void{ var e:MouseEvent = new MouseEvent(MouseEvent.CLICK, true,…
stewbasic
  • 831
  • 7
  • 21
3
votes
2 answers

Generate mousemove event with dispatchevent?

Is there anyway to do a mousemove event with java.awt.Component.dispatchEvent(AWTEvent)? .dispatchEvent(new MouseEvent(client.a .getComponentAt(1, 1), MouseEvent.MOUSE_MOVED, …
3
votes
1 answer

How can I "Map" the up/down arrow keys to Tab/Shift Tab?

For my React App, all I want to do is take the current functionality of Tab and Shift Tab, but have the Up/Down arrows do same thing. I know you can kind of emulate this behavior with Reacts "useRef" and "focus", but my App will have dynamically…
Geoff D
  • 51
  • 3
3
votes
1 answer

Await dispatchEvent: How to listen synchronously to a dispatchEvent when listener is async

In order to develop a plugin for a software, I need to listen to an event spawned with dispatchEvent and do some actions when receiving this event. What is important is that my actions should be finished before the software continues to execute the…
tobiasBora
  • 1,542
  • 14
  • 23
3
votes
1 answer

Redirecting Swing mouse events

I am trying to make it possible to display and interact with Java Swing components on top of a Java3D canvas. I am displaying the components by painting a transparent JPanel to a buffered image, and then painting that buffer over the canvas using…
Andy
  • 7,885
  • 5
  • 55
  • 61
3
votes
2 answers

Simulating keypress into an INPUT field (Javascript)

I'd like to simulate a keypress into an INPUT object. I can't just set the element value because of the way the field is processed. Looks like the solution has to do with dispatchEvent and KeyboardEvent - but there are so many variations and most…
dashman
  • 2,858
  • 3
  • 29
  • 51
3
votes
2 answers

in Which browser can I use "dispatchevent" in the background tab?

I tried dispatchEvent in the background in chrome, but it didn't work. When i try it in firefox, It worked delayed. I'm trying in the same code firefox slow running chrome also does not work, I think this is browser-related. How do I revoke these…
Efe Zeybek
  • 83
  • 1
  • 2
  • 14
3
votes
3 answers

Trigger checkbox change event with plain javascript (NOT jQuery)

I'm building a multiple select with ES6. It's all up and functional (moving trough items, clicking them, highlighting, whatever you want) but the only problem is handling those checkboxes. Whenever an item is highlighted and enter is pressed I must…
3
votes
0 answers

dispatchEvent from react js component

I try to dispatch an event within a react component but It throw me this error: "Uncaught DOMException: Failed to execute 'dispatchEvent' on 'EventTarget': The event is already being dispatched" My global event: var event = new…
Car Lautaro
  • 301
  • 1
  • 2
  • 8
3
votes
1 answer

how to dispatchEvent for a custom object in javascript

Creating a wrapper for video element. function YMplayer() { this.video = document.getElementById("video"); /* video object */ this.addEvents(); } YMplayer.prototype.addEvents = function () { var obj = this.video; var events =…
balaji g
  • 153
  • 2
  • 10
1
2
3
11 12