digit pressed implementation