This question already has an answer here:
I'm using Mac mini, and bought this new bluetooth keyboard. It's not Apple production, but has Apple layout. The other keys all work except "Esc" in the left up corner. Obviously it won't be handy if this important key didn't work. How to fix it, please?