Changing materials in real time using HMD and Oculus Controller input

Hi, I am trying to change materials in real time using oculus controller but can seem to figure out how do i get input from the controller.