Button Action

Hi,

Currently the button widget has 2 option, either alternate between 2 commands or send one fixed command, however I need the alternate but i need it to act like a momentary press switch, i.e. when i press the button i need it to send X and when i release it it needs to send Y.

Any ideas where i should start looking to get this right?

Cheers
Rob

Found ng-mousedown and ng-mouseup

Modified @signal11’s Example that can now be tweaked:

<div>
  <button class="btn btn-lg" style="color: black" ng-mousedown="sendCmd('mqttsw2', 'ON')" ng-mouseup="sendCmd('mqttsw2', 'OFF')">
    <i class="glyphicon glyphicon-menu-down"></i>
  </button>
</div>