Will OpenLaszlo mouse events convert to touch events if i compile the code for mobile target? - touch

I want to know whether the open laszlo mouse down events will be converted to touch events while compiling it in mobile format.

Yes, at least on iPad. I tested this myself on an iPad2 running the OpenLaszlo 4.9.0 in HTML5 (aka DHTML) mode of my application last year for R&D purposes and the following were confirmed to work:
1) Touching a button on the screen in the application in OpenLaszlo HTML5 mode properly triggered the onclick event of the button.
2) Drag and drop with your finger on a touch screen in OpenLaszlo HTML5 mode has the same result as dragging and dropping with the mouse on a non-touch screen system.
Note: This was only tested on the iPad2, it was not tested on Android, Windows Phone, Blackberry, etc.

Flash is not relevant for mobile (since Flash Player has just been removed from Google Play store), but Adobe AIR for Android and iOS is an option, if you want to build native applications. In that case, you have to start capturing the touch events using the ActionScript3 API.

Related

In Flutter, how can I check if a mouse device or a touch device?

How can I check if the device is a touch device or a mouse device?
Using kIsWeb is not sufficient because if using web version of the app on a mobile device kIsWeb returns true, but I need it to return false because it is a touch device.
Checking the platform doesn't work either because if using web version of the app on an iOS device for example returns false for iOS platform check.
Use case - I have two different types of video players for my app. One is suitable for touch devices (you tap to show and hide controls) and one is suitable for mouse devices (controls show when you mouse into the player and hide when you mouse out).
Youtube has the same idea. If I use the youtube app or website on my iPhone I get touch controls. If I use the youtube app or website on my iPad Pro I get touch controls. If I use the youtube website on my Mac I get mouse controls at all screen sizes (even mobile screen sizes).
So I guess I really just need to know platform on the web. I can get platform if not on the web.
Great question #jwasher! I had the same issue - a touch and swipe based UI that was great as a native mobile app, great as an single page web app (SPA) on mobile web browsers, but that was weird and clunky for mouse based interactions when the SPA was used in a desktop web browser.
The solution I have settled on is to wrap sensitive widgets in a MouseRegion (https://api.flutter.dev/flutter/widgets/MouseRegion-class.html) to detect mouse activity at runtime, then reacting by augmenting the UI with buttons to provide a mouse focussed way of triggering actions previously only linked to touch triggers.
You could use this to "mouse-enable" individual widgets, or you could wrap the whole app in a MouseRegion, trip a state field when activity was detected then rebuild the widget tree in a substantially different way for point and click users.
This strategy may incur some minor complexity/CPU overhead on devices that will never have a mouse attached (like a smartphone), but the solution will be more flexible than a build or configuration time capability determination. If a user starts the app on a tablet, then puts it in a stand and attaches a bluetooth mouse - it will react appropriately.
A device isn't "a mouse device" or "a pointer device". Events have an input type--see Pointer event.kind--but not the whole device. A laptop can have a touch screen, and a tablet can have a stylus or external mouse; an app running in those environments can receive both types of event.
Without knowing what you are trying to accomplish with this classification, is hard to advise on how to accomplish it. Trying to style your UI based on a guess of the primary interaction mode, for instance, is a completely different problem than reacting to a mouse event differently than a touch event.

DualTouchControls (Jump) in Unity 5 build for iOS does not detect a screen click

I am currently encountering issues with detecting a touch for an iOS test game. I have imported the Cross PlatformInput library provided by Unity and did include the DualTouchControls in my Scene like so:
When I run the app on my phone I can see the black box but when I press the screen it does not jump my rocket (character). These are the settings of my Jump DualTouchControl:
And here is the rocket itself with its game environment:
What would I like to achieve?
I would like to jump the rocket whenever a user taps his screen on his mobile phone. Previously I didn't work with the DualTouchControls because I mainly build it for desktop for testing purposes. It works perfectly on desktop tho using the spacebar.
Hopefully someone can help me out with some tips.

Detecting when device in cardboard headset in Unity

I'm building a Unity Cardboard app, and would like to detect when the device is in the headset. The NFC in theory has this data, but it does not seem to be exposed in the API. I would like to have the app automatically enter VR mode when in the headset, without the user needing to toggle in and out of a VR mode.
Basically, I want Cardboard.vrModeEnabled to be automatically updated when you enter or exit a headset.
Is this possible? Thanks!
It used to be in the (non-Unity) SDK but was deprecated, for several reasons. For one, the NFC sensors on phones are placed in different places, so the detection was not uniformly reliable. For another, using the sensor this way drains battery quickly.
There are a lot of cardboard models on the market. a lot of them don't come with an NFC tag. so i wouldn't count on it.
Best approach for me is to start in VR mode, when the user touches the screen, disable VR mode for 10 seconds since the last touch and then go back to VR mode.

html5 <audio>: how to use the built-in `next`, and `previous` controls on iOS 4.2 / Android 2.3

Both on Gingerbread 2.3 and iOS 4.2+ the HTML5 <audio> tag generates an interface with next, and previous buttons.
How do I hook into those controls?
It doesn't appear to be one of the HTML5 Media Events according to
W3Schools
HTML5 Spec.
Safari Developer Library: Controlling Media With JavaScript
What JavaScript events do they emit or do they send HTTP ICECast messages?
(No HTTP headers are sent on the button click)
For an example with screenshots, see https://coolaj86.com/demos/sandbox/html5-audio-tag.html
On Android:
if you have gingerbread or better you'll see the controls in the webapp by default.
On iOS (iPhone, iPod, iPad):
Begin playing the music sample on your iPod/iPad/iPhone
Then click the button to "background" the app.
Double click and swipe from left to right in the lower menu to access the player controls.
Note: play/pause control does work more or less as expected (setting the appropriate Content-Range HTTP header helps)
As for iOS
From the webkit-help mailing list:
These Next/Previous buttons are not
part of the standard HTML5 media
player controls.
On iOS at least, they are simply there
because the same controls are used for
audio playback in web pages as other
audio playback on the device. For web
pages, they just go to the start and
end for the track. You can't modify
this behavior from JS.
AFAIK, mobile phones (android/iphone) open the default player when you attempt to play any media file using the new HTML 5 specification.
There's no way to control those buttons since the actual playback is done via the media player application.
I don't know if intended, but so far, http://www.schillmania.com/projects/soundmanager2/demo/page-player/ works with the NEXT button while you are CURRENTLY PLAYING any audio. If the audio finishes, the NEXT button stops working. And the PREVIOUS button doesn't go to previous song, but restarts current song.
I don't know if Scott (the creator) has coded this, or not. I've tried debugging that page JS files, and didn't find any next/prev logic done.
Clearly, it should be possible. It's working kind of buggy and there is no documentation, but let's build it!
What do the buttons do?
When playing:
Next: go to last ms of the audio, so it triggers onfinish event.
Prev: go to first ms of the audio, means nothing, plays again from start.
When not playing: (depends on if audio stopped or never played)
Next: Nothing
Prev: Nothing
:/ So far, that's the info I have. I'm trying to monitorEvents without success, it should be triggering some event.

MobiOne/Jqtouch - SWIPE

I am not able to simulate the SWIPE event in MobiOne simulator while using Jqtouch.
How to use mouse to simulate swipe.
Thanks
Coool
If you are using the latest MobiOne 1.0M9 version, it's iphone emulator supports JQTouch swipe events. Load this swipe demo URL http://www.ryanscherf.net/demos/swipe/ in the MobiOne iPhone Emulator. Press left-mouse down while dragging across the swipe regions. You should see an alert dialog with a msg stating you swiped left or right respectively. Use the MobiOne "Send To My Phone" to quickly share the URL with your iphone/itouch device and see it live.
Contact MobiOne Support for more followup. www.genuitec.com/support-mobione
Wayne