How to get HOME button event in Debian on A13-SOM-512

Started by tkunz, March 17, 2016, 06:59:49 PM

Previous topic - Next topic

tkunz

If I want to see when the HOME button is pressed on the A13-SOM-512 from within Debian, where would I look?  I know the button circuitry works fine, I use it to wake the board from sleep mode.  I would like to catch it being pressed to run my "sleep me now" scripts.  I can see the other GPIO pins in /sys but it's not obvious to me where I would look for this.
Thanks,
Tom

tkunz

I have an answer.  The device is driven by the sun4i_keyboard driver module and is found in /dev/input/event1 when loaded.  If you just read from that device file into a "struct input_event" as found in /usr/include/linux/input.h you get a key.type = 1, key.code = 102 and key.value = 1 on press and 0 on release.

Hopefully this will help someone else some day.