^ this.
By the way, my experience with HMIs writing both the 1 on the button press as well as the 0 on the button release is that it is far less reliable. I don't know why, it almost seems as if sometimes the write of the 1 on the press gets lost, then the write of the 0 on the release gets sent (which changes nothing because the 1 was lost), and then the HMI notices that the 1 packet was not acknowledged so it sends it again, and if that second 1 is not lost then the bit value is left as a 1 even though the button has been released. Set and forget is more reliable: at least if the 1 packet is lost the user has only to press the button again and nothing gets out of sequence.