Is there anyway to use logic operations with touch action

If a button is pressed I want to do something. Is this possible to do using C#?