I have a problem that I cannot input using the Stylus pen in Unity Android.
When the Stylus pen touches the screen, the first OnPressDown event is called, but then OnPressUp is not called, and all pen inputs are not operated afterwards.
OnClick of Unity's UGUI Button is not being called either.
Pens that work normally in other Android apps, but the above problem occurs in Android apps built by Unity.
The pen is made in China, but the exact model is unknown.
Is there anything in doubt?
Please understand that the sentence may be awkward using a translator.
I solved myself
The handling of pen input is included in the Input System Package supported in Unity 2019 or higher, so the problem was solved by installing the package.
Related
I would like to be able to use my hardware keyboard (on my M1 MacBook) within games (such as stumble guys) on android studio.
I use a Pixel 4 API 31 (ARM 64) on android 12.0.
The keyboard works for typing functions where the onscreen keyboard would be required.
However I am wondering how I can use my keyboard to emulate touch instead of having to use my mouse. Can I assign keys to areas on the phone ?
Any help would be appreciated
The feature you request would have to be built into the emulator - translating keyboard input to touch inptu before it hits the target Android software. Since you're saying "on android studio" I'm assuming you refer to the AVD Android Studio Emulator. I am pretty sure that emulator does not support the feature you request, nor have I heard of any other that supports it.
UI mask do not work with Google's Cardboard SDK? It works properly with the Oculus Mobile VR plugin but with the Cardboard SDK the masks seem to be gone.
http://postimg.org/image/b2by7exu9/
This screenshot demonstrates it, outside of the white box we should not see any text.
http://postimg.org/image/ts8wgfu7l/
In editor and with VR Mode disabled it looks fine.
Did anybody encounter this issue and know how fix?
In which direction should I investigate further?
I already tried the builds on Note 4 and Galaxy S3 with two different projects just to be sure. Logs didn't show striking lines. I googled and did not found anything related to this issue. Answers and forums the same.
Any suggestions highly appreciated!
While not an answer to your question - I figure after this long any information could be helpful:
I've noticed that the Cardboard SDK in general doesn't play nice with the Unity UI at times. I found that when enabling or disabling VR mode on Cardboard, my UI would cease to respond to touch inputs on other (2D) scenes. I solved this by turning VR mode before changing scenes. So perhaps you need to dig around inside Google's code to see where it's messing with your UI...
have you re-tested with Unity 5.3? there were a bunch of improvements in this area including a re-write of the masking system.
Alternatively, check out the UI Soft Alpha mask component as part of the UI extensions project (https://bitbucket.org/ddreaper/unity-ui-extensions) which is a shader based mask system with Alpha support
Hope this helps
I discovered this still happening in Unity 5.6.0f1 with Google Cardboard. I was able to fix it by going into the Cardboard SDK settings (PlayerSettings (Android) -> Other Settings -> Virtual Reality SDKs -> Cardboard) and switching the depth format to "24-bit depth | 8-bit stencil" (since the UI mask uses the stencil buffer). This solved the masking problem for me.
So I have an issue with the fairly new Unity 4.6 UI system.
I have a multiplattform project and everything works fine (pc/ ios) but my input fields for the user to log in sometimes don't open the Touchkeyboard, or it is not possible to focus them.
I guess I have to open the keyboard manually, focus the inputfield and do the navigation myself, but there is not a lot of documentation about it...
so my questions:
How do I hide the mobile input field (the one above the keyboard) via Script on run time?
How can I keep the keyboard always open, but still use the submit-event of the keyboard?
Any other cool ideas which could fix my issue?
I am running on my test device android 4.1.2, 4.2.2 and 4.4.2 and I can recreate that problem on all of those, even though 4.4.2 seems to be the worse.
Thank you very much my brave Unity UI warriors!
Make sure you are using latest unity version, they had a few bugs related to InputField in 4.6. If that doesn't help, you should try patch releases.
How to hide InputField additional input box in unity3d
I am using systrace to dig into the performance issue in my app, I am wondering if there's a way to add a tag / marker when certain event happens in the systrace result? The specific event I am looking for is input event, but it's hard to tell from systrace which input event is which. I am on Android 4.2.2
Cheers,
Johnny
You can, using android.os.Trace, but the feature wasn't added until Android 4.3 (API 18). You can find an example here.
I want to use pen in android tablet . I use pen and want to write text with pen. How can I develop the android application to be accept only pen input in EditText . Can I use pen in emulator ? Is there any usable API for this .?
As far as I know, only HTC supports a pen on some their android tablets (please someone correct me if I'm wrong, I may not be up-to-date on these things). Their pen can be used concurrently while you're touching the device because their screen can tell the difference between your finger and their special pen.
Here is a link to their pen api
http://www.htcdev.com/devcenter/tablet-pen
(free registration with their site is required I believe)
I believe they have an HTC SDK you can download with the AVD manager, but I just don't know if it comes with a special emulator for their pen api -- I haven't tried it yet.
Also other android tablets/phones can be used with pens, even if they're technically not made to support pens (but those pens are just special styluses that emulate the capacitive touch of your finger), so with those devices, the screen can not tell the difference between your fingers and that pen (so you can not assign them different functions which is definitely not as good).