- Home /
disable secondary touch input (android)
Hello Developers!
I want my app to not take inputs from secondary input touch, i.e.
bool status = AndroidInput.secondaryTouchEnabled();
should always return "false". I know it is a "readonly"..
I'm getting it true and false randomly. How do I solve this problem?
Any help is much appreciated! Thanks in advance!
what exactly am also searching .... is any one have idea ?
@jainam Are you check the application on the real device?
@zharik86 yes i have checked in Device. behavior is very random (sometimes returns true sometimes false) .
It is strange if it is included. I looked at a code from other question. Probably, in it AndroidInput.secondaryTouchEnabled need to transfer from OnGUI to other function. (if you want to know the status of your event each frame). The problem can be that the OnGUI function is executed several times for one frame. So, I suggest to try:
private bool statSec = false;
...
void Start() {
statSec = AndroidInput.secondaryTouchEnabled;
...//your initialization code next
}
void LateUpdate() {
statSec = AndroidInput.secondaryTouchEnabled;
}
void OnGUI() {
... // your code
if (statSec) {
status = "enabled";
count = AndroidInput.touchCountSecondary;
...
}
...
}
actually, my app doesn't need to know the status of AndroidInput.secondaryInputTouch. in fact, the app requires it to be false so that it can receive gesture information from android plugin. but randomly and most of the times, the status is "true" after which the gesture information is not passed to unity via UnitySend$$anonymous$$essage.. any clue??