switch e.keyCode to e.which

jQuery standardizes on 'e.which', however both 'e.keyCode' and 'e.which'
acheive the same effect.

http://api.jquery.com/category/events/event-object/
fix reversed state

I had it backwards the first time.