src/events/SDL_keyboard.c
changeset 6803 fbe83a6d10fa
parent 6665 c0ea8c57034c
child 6811 60d95fcfaf3c
equal deleted inserted replaced
6801:f92e3d5f71a2 6803:fbe83a6d10fa
   951 SDL_Keycode
   951 SDL_Keycode
   952 SDL_GetKeyFromName(const char *name)
   952 SDL_GetKeyFromName(const char *name)
   953 {
   953 {
   954 	SDL_Keycode key;
   954 	SDL_Keycode key;
   955 
   955 
       
   956         /* Check input */
       
   957         if (name == NULL) return SDLK_UNKNOWN;
       
   958         
   956 	/* If it's a single UTF-8 character, then that's the keycode itself */
   959 	/* If it's a single UTF-8 character, then that's the keycode itself */
   957 	key = *(const unsigned char *)name;
   960 	key = *(const unsigned char *)name;
   958 	if (key >= 0xF0) {
   961 	if (key >= 0xF0) {
   959 		if (SDL_strlen(name) == 4) {
   962 		if (SDL_strlen(name) == 4) {
   960 			int i = 0;
   963 			int i = 0;