split key_code_from_glfw function to glfw2 and glfw3