How to use Gecko Mouse gesture events? - dom

i'm developing a webGL Desktop app, and i'd like to provide a multi-touch interface.
It seems that the only solution concerning desktops is https://developer.mozilla.org/En/DOM/Mouse_gesture_events , but how do i include it in my javascript code? How do I call the gesture callback functions, what do i have to include?
I'm not used to web development and i'm still learning a lot, so forgive me if it's a dumb question.
thanks!

How were you planning to trigger the multi-touch events on a desktop? Touchscreen? Magic Trackpad style input? If you’re going down that route then Gecko has touch events that handle multi-touch fine.
The main problem with your original solution is summer up with this paragraph:
Note: These gesture events are available to add-ons and other browser chrome code, but are never sent to regular web page content.
If you’re just building your app as a Fluid-style SSB then you’re not going to have these events available; you’d have to build your app as a browser extension to get into the correct security model.

Related

Wear OS 2.0 - Is there any way to process html, web page, programmatically?

I can't seem to find ANY information on Android Wear OS and html. My end goal is just to show a simple web page with buttons for IOT control. I have all the backend already. I know I can use other views but my backend dynamically creates a page of buttons. I'm open to other ideas for dynamically building an interface. I know webview isn't supported. I found crosswalk-project but it's no longer maintained and seem too complex for my needs.
GeckoView might be a good starting point https://firefox-source-docs.mozilla.org/mobile/android/geckoview/consumer/geckoview-quick-start.html
https://searchfox.org/mozilla-central/source/mobile/android/geckoview_example
But it probably won't be a great experience.

Simulate actual button press on mobile-safari on iPod Touch / iPhone

I am building a web-based tool for internal purposes for my company that runs on an ipod touch. It's working fine, but there are a few quirks such as not being able to auto-focus on a text field when a page loads without the user actually tapping the screen (I can "focus" the field, but the keyboard is not active). Additionally, I cannot programmatically trigger sounds to play (I am using the jPlayer library). What it seems to come down to is this:
Is there some way I can trick the browser on an ipod touch 4 to thinking the user has actually tapped a specific div on the screen? If I can do that, I can solve every other issue. Since this is for internal purposes, I am free to make any modifications needed. However, I need to able to do keep the "app" code in HTML5 and JavaScript for a myriad of reasons. Perhaps an app with a modification to safari to allow this, then I can run my site in that app?
Perhaps an app with a modification to safari to allow this, then I can run my site in that app?
Yes, you could write a really simple app with just a UIWebView in which you display your HTML5 based app. If you need extra things such as back button etc. you would have to implement that (it's also not very difficult). The UIWebView should behave mostly exactly like Safari, so it should be a de facto "app with a modification to safari".
You could then give the right element focus and call
[webView becomeFirstResponder];
The sounds could also be played programmatically by simply requesting the appropriate URL.
I think with this setup the additional effort in terms of coding beyond your existing web based tool is minimal. However, this assumes you have Xcode, know some basic Objective-C and are familiar with the procedures of ad hoc or company distribution of "real" apps.
You can try to use a timed event

Find focus in OS X

Is it possible to create an app for the mac (and iphone afterwards) that does something when it detects that the focus is on a certain object in the screen?
Meaning, the program runs in the background, and when it detects that the focus (or cursor) is on an edit box, it will run something.
Hopefully I made myself clear!
Thanks!
You can do this on the mac by using the Accessibility Framework.
Note that users will have to manually enable assistive devices and you will not be able to distribute your app on the Mac App Store due to Apple's soon-to-be-implemented sandboxing restriction.
On iOS, you can detect focus to certain but not all elements using specialized delegate methods such as textViewDidBeginEditing:. That said, as users use taps to navigate iOS apps most of the time, simple tap handling seems like a much better approach.
On the iPhone, you can only detect focus within your own app, there's no way to observe other apps from the background.
On the Mac, as 0x90 noted, the closest you'll get are the Accessibility APIs. The UIElementInspector sample code may help you to get started.

How can I code an efficient mobile site like gmail's?

My web site has a different mobile version that's suited for iPhone/Android devices. The problem, however, seems to be in the site's performance. It's really slow and heavy, even though I'm not loading any images.
On the other hand, when I use Gmail's or YouTube's mobile version, they're so fast they almost perform like a native mobile application.
How do they do that?
Your help is much appreciated :)
See my comment. Also, if the slowness you perceive is when interacting with the site it could be that it lacks the ability to accept touch events. On mobile web, if you have not wired up the UI for js touch events the experience will seem slower because the device browser has to fall back to standard click and other mouseevents which are not optimal. Frameworks such as mootools and jquerymobile/jqtouch have these events baked in. Take a look at the mootools solution which has quite a good write up: http://davidwalsh.name/mootools-touch
They probably making use of local storage http://dev.w3.org/html5/webstorage/
Are your pages too large? Try to use gzip and/or reduce output
Your server's connection speed may also be responsible of slowness
Well, You don't need to include any javascript framework to make it fast clickable.
By implementing some JavaScript you can achieve that. Google has released a solution for that
https://developers.google.com/mobile/articles/fast_buttons
This will allow visitor to interact with application native way. From Android 4 (as far as I remember) version by setting viewport meta tag the browser will automatically apply the fast click functionality.
For the animation issue always use Hardware accelerated animation with a fall back for older mobile browser. Using hardware accelerated animation it will make your application smooth as silk.
Follow this guideline and you can make your application as fast as gmail / youtube mobile version.
http://www.html5rocks.com/en/tutorials/speed/html5/
Best of luck.
Your webapp is consuming too much RAM. Don't use so many libraries and don't attach so many event handlers.

Can I prevent mobile safari from auto-rotating the screen on ipod touch or iphone?

We have a web app that is being developed. It will be used on an ipod touch that is built into a tabletop. As it is basically horizontal, the ipod keeps changing its mind about which way up it is and keeps switching the orientation of the browser.
Is there a way to ask it to stop doing that? If not, is there an alternative browser that will let me prevent screen rotation that anyone can recommend?
If you have an API key, it would be pretty much trivial to make such an app. Just stick a UIWebView into a nib and hook up a text field for the address bar.
If you don't have access to dev tools, take a look at the built-in browsers in pretty much every app. Very few support rotation.
I imagine there is a 3rd party app that has some alternate functionality in addition to a web browser that might offer what you need. Beyond that is outside of the scope of stackoverflow….