Forums » General

Question regarding control toggle commands

Mar 11, 2016 Unit-32 link
Hey, I have a question regarding control input on the Android platform.

Basically, I am wondering if there is a way to have my accelerometer switch between two modes at the press of a key.
I turn on mouselook in different situations and use an input field onscreen as a sort of trackpad emulator, very handy. When I enable mouselook it overides my accelerometer pitch/turn, which is good. When I have mouselook off, my accelerometer is enabled, and is used for looking around.

What I would like to happen, is when I enable mouselook, my accelerometer will switch to something like roll/throttle, and return to my default pitch/turn once I turn mouselook off.

I am not sure if this is possible, but I don't see why not. I am thinking maybe an alias? something along the lines of

"alias controleswitch1 'mlook 1; (bind accelerometer x roll y throttle)'"
"alias controleswitch2 'mlook 0; (bind accelerometer x turn y pitch)'"

I don't know what lua uses for accelerometer commands, and I have very little knowledge of how any of this works. If anyone knows a way to achieve this, I would be really grateful :)
Mar 11, 2016 yodaofborg link
have you tried using the already used stuff?

/toggleflightmode ?
Mar 11, 2016 abortretryfail link
It's /flymodetoggle
Mar 11, 2016 draugath link
You want to bind your commands to ACCELX and ACCELY
Mar 11, 2016 Unit-32 link
Thank you draugath, just what I needed :)
Mar 14, 2016 draugath link
There is also an ACCELZ, but I don't really understand how it's supposed to work.
Mar 14, 2016 raybondo link
The accelerometer reports 3 values, one for each major axis.
Z is pointing through the screen, so if you lay your device flat on a table, X and Y should report 0 and Z should report maximum (or negative max, I forget) value.
So Z (instead of Y) could be used for tilting the screen towards and away from you to pitch up and down.
I think that's how it works, I'm not going to spend any more time looking it up, sorry.
Mar 14, 2016 Barktooth link
Thanks a lot, I got it figured out :)
Mar 15, 2016 draugath link
It's also important to note that if you bind something to the accelerometer in this way and then later open Options>Advanced>Controls, the binds will be overwritten if you save any settings.