How to use buttons on owrt

As I've switched to the 18.06 from the ChaosCalmer I noticed that my buttons handlers aren't working. Additionally it was possible to set buttons handlers even in LUCI which isn't the case no more. According to the devs this feature was dropped because it was only Atheros specific.

Well, the wiki article somehow touched the procd buttons and apparently mentioned 00-button script in '/etc/hotplug.d/button didn't work. To make it work I created scripts (marked grey on the picture below) in the /etc/rc.button:


Green ones were there by default and according to the source code of the 'kmod-gpio-button-hotplug' there could be only buttons depicted above

The content of newly created scripts is the same:


As the result BTN_* and wps buttons events are redirected to the older handling script which makes it possible to define button handlers in uci.

For particular hardware only some specific buttons handlers in '/etc/rc.button' will be active. For my hardware for example only BTN_5,BTN_6,BTN_7 are active. The button names could be found btw in the hardware description file (mine is 'target/linux/ar71xx/files/arch/mips/ath79/mach-wzr-hp-ag300h.c').

Now my questions to devs are:

  1. Can this approach be used by default for all platforms generically? If yes then even LUCI module could be reenabled. Buttons for all!
  2. Is the slide-switch module mentioned in the wiki article really needed? Because I receive press/release events for switches