To my knowledge, you wouldn’t be able to keep that functionality unless you are somehow able to retrieve whatever chip is on the button that is responsible for communicating with your device. This practice is seen in many different electronics and cannot be avoided unless you can preserve and transfer the chips from the oem board to replacement. I dont know if it is even possible to achieve but that would be the only method to my knowledge, and that method requires some deep knowhow and ability.