I would like to map the auto-rotate lock toggle/switch/setting to a physical button in a device. how do I do that?

On the linux side of android, in linux/input.h, there are different KEY events, SW(switch) events and a lot more. fortunately, the rotation lock is there(SW_ROTATION_LOCK), however it is a switch event type, not a key event type...

Looking in my key layout file (.kl file), all items that are listed there are key events...

On the other hand, the assigned events to these keys are constants in the android framework. looking at http://developer.android.com/reference/android/view/KeyEvent.html where valid key maps are listed, I assume.

What I have done: Registered the physical button to recieve the rotation lock as a switch event on the board configuration settings... (imx6 board) all that's left is on the android side I believe..

so, anyone knows how to map the button to auto-rotation lock/switch?



You must log in to answer this question.

Browse other questions tagged .