rename keyCode to KEY, add new constants
save constants to local vars, move to core