A state transition from 0 to 1 should fire the close event and vice-versa - the comments in the code mention a normally open switch - ie. open = not pressed = inactive = 0. Alternatively language other than open/close might such as activate or deactivate might fit better
A state transition from 0 to 1 should fire the
close
event and vice-versa - the comments in the code mention a normally open switch - ie. open = not pressed = inactive = 0. Alternatively language other than open/close might such as activate or deactivate might fit better