cleaned up code a bit and added get_keycode_from_string