Controlling a device based on 2 inputs