define on pressed key event pressed