You can test if your powerbutton sends a keycode with evtest, the driver basically registers the button like another keyboard:
Code:
ubuntu@pine64:~$ sudo apt-get install evtest
Reading package lists... Done
Building dependency tree
Reading state information... Done
evtest is already the newest version (1:1.33-1).
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
ubuntu@pine64:~$ sudo evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0: sunxi-keyboard
/dev/input/event1: axp81x-supplyer
/dev/input/event2: sunxi-ths
/dev/input/event3: audiocodec sunxi Audio Jack
/dev/input/event4: sunxi_ir_recv
/dev/input/event5: MCE IR Keyboard/Mouse (sunxi-rc-recv)
Select the device event number [0-5]: 1
Input driver version is 1.0.1
Input device ID: bus 0x19 vendor 0x1 product 0x1 version 0x100
Input device name: "axp81x-supplyer"
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 116 (KEY_POWER)
Event type 2 (EV_REL)
Properties:
Testing ... (interrupt to exit)
Event: time 1466799328.888825, type 1 (EV_KEY), code 116 (KEY_POWER), value 1
Event: time 1466799328.888825, -------------- SYN_REPORT ------------
Event: time 1466799328.999256, type 1 (EV_KEY), code 116 (KEY_POWER), value 0
Event: time 1466799328.999256, -------------- SYN_REPORT ------------
Event: time 1466799329.630542, type 1 (EV_KEY), code 116 (KEY_POWER), value 1
Event: time 1466799329.630542, -------------- SYN_REPORT ------------
Event: time 1466799329.798206, type 1 (EV_KEY), code 116 (KEY_POWER), value 0
Event: time 1466799329.798206, -------------- SYN_REPORT ------------
ubuntu@pine64:~$
Come have a chat in the Pine IRC channel >>