Since I'm searching for an answer for a while now and I'm still without any clue, I'll just describe my actual problem:
I need to build up automated touch/mouse gestures (tap,drag,pinch...) which I can fire on a webpage in order to test touch frameworks and their performance. Thus I want to trigger "global" touch/mouse events on a webpage with JavaScript without dispatching them from a specific element.
Does anyone know how I could achieve this or how these events are delegated in general?
If you need this just for the sake of emulating mobile touch actions on your browser, Chrome already has a tool for that. Check out Mobile Emulation.
Related
so I want to create cross-platform app that will be invisible overlay over whole screen. When user interacts with whatever is under, I want to catch the event (mouse location, mouse click etc) so I can have info of what user attempted and where, and then "pass" the event through. Also, I might wanna display something in overlay as result of the event.
Coming from .NET, I understand how I would hook into mouse events. I also understand that it is possible to simulate user clicks with Mouse class in .NET Core. However I was wondering if this is possible with electron, as I was checking it for cross-platform solution.
I checked some topics (like this click-through discussion) that mostly deal with passing events through overlay, but I am not sure those do this catching-then-passing. So is there something like that and is it actually possible with only electron/nodeJS? Or would I have to use additional libs, and would they be different for Win/Linux/Mac?
I checked at:
Overlay Electron and
electron-overlay-window
but both seem complicated with attaching to game and following the window respectively. I was hoping it is possible and simple somehow.
IMHO, it's is possible, but will require a ton of OS-specific code and possibly some native modules.
I suggest to start with https://www.electronjs.org/docs/api/browser-window#wingetnativewindowhandle and https://www.electronjs.org/docs/api/browser-window#winsetignoremouseeventsignore-options
I am building a Javascript based application with PHP and mysql in backend.
Because of complexity of code, I want to be able to trigger custom events and do operation whenever that even is captured.
So I came across this and this. According to this we can use jQuery triggers as well.
Great? Not Yet. In those documents it says that these custom events are not supported by IE.
However, I have used jQuery plugins before which uses custom events and works on IE.
My questions are
Are custom events supported by IE?
How can I find compatibility across browsers?
What is the correct way to use custom events?
Are there any jQuery Plugins which caters for custom events ?
Are there any NEGATIVE impacts of using custom events?
Question 1, 2 & 3 are the main concern to ask this question.
JQuery normalises it's own event structure over the top of the existing browser's implementation for cross-browser consistency.
Essentially you can trigger a custom event on an element and it will JQuery bubble up the event through the DOM tree, triggering the event on each element unless the event stop propagation is called. JQuery 1 supports IE 6 & above and JQuery 2 supports IE 9 & above.
http://api.jquery.com/category/events/event-object/
http://api.jquery.com/trigger/
http://jquery.com/browser-support/
The official documentation only says:
The event's type, such as "click", "blur" or "keypress".
For iOS devices the touchstart is another event which is working. Where can I get the full list of all possible events? I like for example actually to get the event for the <select> event hasChanged(). Is this based on another library?
Meteor doesn't define the events it supports — it simply creates a cross-browser event listener wrapper. If you wanted to create custom events and trigger them, Meteor would pick them up.
The native input events supported depends on the browser: the Mozilla Developer Network reference is a good place to start.
Th docs also says that all the DOM events are also possible in addition to click, focus, blur, etc.
Other DOM events are available as well, but for the events above,
Meteor has taken some care to ensure that they work uniformly in all
browsers.
You can see the list of available Javascript events here and here.
I have not used Ember.js before, but after reading the part of the guide on views, I wanted to know how the Ember experts out there would handle a situation where multiple native events needed to be mapped to the same "application event".
In the guide, the example given shows mapping the (native) click event to the (application-specific) deleteItem event. In many cases, it is common for many native events to map to one application-specific event. What if a user was using a touch device that also had a keyboard and mouse attached (e.g. soon-to-come Windows 8 tablets), and I needed to map the "touchstart", "click" and "keyup" (e.g. [CTRL]-D) events to the same application-specific event like deleteItem?
Would you just put 3 methods on the view -- touchStart, click and KeyUp -- and have them all call a common 4th method to send the deleteItem event?
Is there anything built into Ember to handle this situation -- specifically, the situation where multiple native events all have the same semantic meaning in an app? I think this will become more and more common as browsers are touch enabled, laptops are touch-enabled and browser APIs can accept input from other hardware like mic, camera, etc... I could imagine a device where 5 or 6 native events all have the same semantic meaning for a given view.
Thanks!
We've been talking about something similar to support 'tap' events.
I think the best approach is to use register jQuery 'special events'. Here's a link to more information: http://benalman.com/news/2010/03/jquery-special-events/
To make a special event work with Ember views, you'll need to register it as a custom event on your Ember.Application instance:
Ember.Application.create({
customEvents: {
// key is the jquery event, value is the name used in views
myeventname: 'myEventName'
}
});
I am writing a chrome extension that records your actions like ( mouse click, keyboard keyup ). The idea of the extension is to help me and my colleagues to reduce the boring testing of our web based project. I made it to record the events and store it on the dev server as mysql so i can use or share to them. But the problem is replaying the saved actions.
So how if there is a way to force mouse move, mouse click events. Can it be done from flash,java or something like that.
PS. The project is Extjs but i want to make the extension useful for developer using other frameworks and publish it.
Consider using Selenium for this. It has support for many languages, and you can script your whole test with it. You can for example set it to click on an element, wait for something to happen or fill text boxes.
Imagine some random website controlling your mouse ... not cool, is it? (That's why you cant force mousemove via javascript)
However, you can trigger clicks on elements. To achieve that, you need to save the event(mouse-over|out/(dbl)click/whatever) and the according element (in the eventfunction: this). That should be sufficient to simulate theworkflow.
jQuery-Example:
$('#item').click();
$('#item').trigger('click');
vanilla javascript:
document.querySelector("#item").click();