Fix issue 333: Text window which never closes when opened by 'T'
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1425 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
		
							parent
							
								
									bf53a167ec
								
							
						
					
					
						commit
						bd87a620c3
					
				@ -377,7 +377,7 @@ testsed :
 | 
			
		||||
 | 
			
		||||
$(BIN) : $(OBJ)
 | 
			
		||||
	test -d ../bin || $(MKDIR) ../bin
 | 
			
		||||
	$(CC) $(OBJ) -o $(BIN) $(LOPT) $(LFLAGS)
 | 
			
		||||
	$(CC) $(OBJ) -o $(BIN) $(COPT) $(LOPT) $(LFLAGS)
 | 
			
		||||
 | 
			
		||||
# SVN revision number
 | 
			
		||||
version.c :
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										16
									
								
								src/input.c
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								src/input.c
									
									
									
									
									
								
							@ -86,30 +86,30 @@ short Joybutton_left_click=0; // Button number that serves as left click
 | 
			
		||||
short Joybutton_right_click=0; // Button number that serves as right-click
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
int Is_shortcut(word Key, word function)
 | 
			
		||||
int Is_shortcut(word key, word function)
 | 
			
		||||
{
 | 
			
		||||
  if (Key == 0 || function == 0xFFFF)
 | 
			
		||||
  if (key == 0 || function == 0xFFFF)
 | 
			
		||||
    return 0;
 | 
			
		||||
    
 | 
			
		||||
  if (function & 0x100)
 | 
			
		||||
  {
 | 
			
		||||
    if (Buttons_Pool[function&0xFF].Left_shortcut[0]==Key)
 | 
			
		||||
    if (Buttons_Pool[function&0xFF].Left_shortcut[0]==key)
 | 
			
		||||
      return 1;
 | 
			
		||||
    if (Buttons_Pool[function&0xFF].Left_shortcut[1]==Key)
 | 
			
		||||
    if (Buttons_Pool[function&0xFF].Left_shortcut[1]==key)
 | 
			
		||||
      return 1;
 | 
			
		||||
    return 0;
 | 
			
		||||
  }
 | 
			
		||||
  if (function & 0x200)
 | 
			
		||||
  {
 | 
			
		||||
    if (Buttons_Pool[function&0xFF].Right_shortcut[0]==Key)
 | 
			
		||||
    if (Buttons_Pool[function&0xFF].Right_shortcut[0]==key)
 | 
			
		||||
      return 1;
 | 
			
		||||
    if (Buttons_Pool[function&0xFF].Right_shortcut[1]==Key)
 | 
			
		||||
    if (Buttons_Pool[function&0xFF].Right_shortcut[1]==key)
 | 
			
		||||
      return 1;
 | 
			
		||||
    return 0;
 | 
			
		||||
  }
 | 
			
		||||
  if(Key == Config_Key[function][0])
 | 
			
		||||
  if(key == Config_Key[function][0])
 | 
			
		||||
    return 1;
 | 
			
		||||
  if(Key == Config_Key[function][1])
 | 
			
		||||
  if(key == Config_Key[function][1])
 | 
			
		||||
    return 1;
 | 
			
		||||
  return 0; 
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -36,7 +36,7 @@
 | 
			
		||||
int  Get_input(void);
 | 
			
		||||
 | 
			
		||||
/// Returns true if the keycode has been set as a keyboard shortcut for the function.
 | 
			
		||||
int Is_shortcut(word Key, word function);
 | 
			
		||||
int Is_shortcut(word key, word function);
 | 
			
		||||
 | 
			
		||||
/// Adjust mouse sensitivity (and actual mouse input mode)
 | 
			
		||||
void Adjust_mouse_sensitivity(word fullscreen);
 | 
			
		||||
 | 
			
		||||
@ -358,7 +358,7 @@ word Keysym_to_keycode(SDL_keysym keysym)
 | 
			
		||||
  return key_code;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const char * Key_name(word Key)
 | 
			
		||||
const char * Key_name(word key)
 | 
			
		||||
{
 | 
			
		||||
  typedef struct
 | 
			
		||||
  {
 | 
			
		||||
@ -447,30 +447,30 @@ const char * Key_name(word Key)
 | 
			
		||||
  static char buffer[41];
 | 
			
		||||
  buffer[0] = '\0';
 | 
			
		||||
 | 
			
		||||
  if (Key == SDLK_UNKNOWN)
 | 
			
		||||
  if (key == SDLK_UNKNOWN)
 | 
			
		||||
    return "None";
 | 
			
		||||
  
 | 
			
		||||
  if (Key & MOD_CTRL)
 | 
			
		||||
  if (key & MOD_CTRL)
 | 
			
		||||
    strcat(buffer, "Ctrl+");
 | 
			
		||||
  if (Key & MOD_ALT)
 | 
			
		||||
  if (key & MOD_ALT)
 | 
			
		||||
    strcat(buffer, "Alt+");
 | 
			
		||||
  if (Key & MOD_SHIFT)
 | 
			
		||||
  if (key & MOD_SHIFT)
 | 
			
		||||
    strcat(buffer, "Shift+");
 | 
			
		||||
  if (Key & MOD_META)
 | 
			
		||||
  if (key & MOD_META)
 | 
			
		||||
    strcat(buffer, "\201");
 | 
			
		||||
  // Note: Apple's "command" character is not present in the ANSI table, so we
 | 
			
		||||
  // recycled an ANSI value that doesn't have any displayable character
 | 
			
		||||
  // associated.
 | 
			
		||||
  
 | 
			
		||||
  
 | 
			
		||||
  Key=Key & ~(MOD_CTRL|MOD_ALT|MOD_SHIFT);
 | 
			
		||||
  key=key & ~(MOD_CTRL|MOD_ALT|MOD_SHIFT);
 | 
			
		||||
  
 | 
			
		||||
  if (Key>=KEY_JOYBUTTON && Key<=KEY_JOYBUTTON+18)
 | 
			
		||||
  if (key>=KEY_JOYBUTTON && key<=KEY_JOYBUTTON+18)
 | 
			
		||||
  {
 | 
			
		||||
#ifdef __GP2X__
 | 
			
		||||
    
 | 
			
		||||
    char *button_name;
 | 
			
		||||
    switch(Key-KEY_JOYBUTTON)
 | 
			
		||||
    switch(key-KEY_JOYBUTTON)
 | 
			
		||||
    {    
 | 
			
		||||
      case GP2X_BUTTON_UP: button_name="[UP]"; break;
 | 
			
		||||
      case GP2X_BUTTON_DOWN: button_name="[DOWN]"; break;
 | 
			
		||||
@ -491,45 +491,45 @@ const char * Key_name(word Key)
 | 
			
		||||
      case GP2X_BUTTON_SELECT: button_name="[SELECT]"; break;
 | 
			
		||||
      case GP2X_BUTTON_VOLUP: button_name="[VOL UP]"; break;
 | 
			
		||||
      case GP2X_BUTTON_VOLDOWN: button_name="[VOL DOWN]"; break;
 | 
			
		||||
      default: sprintf(buffer+strlen(buffer), "[B%d]", Key);return buffer;
 | 
			
		||||
      default: sprintf(buffer+strlen(buffer), "[B%d]", key);return buffer;
 | 
			
		||||
    }
 | 
			
		||||
    strcat(buffer,button_name);
 | 
			
		||||
#else    
 | 
			
		||||
    sprintf(buffer+strlen(buffer), "[B%d]", Key-KEY_JOYBUTTON);
 | 
			
		||||
    sprintf(buffer+strlen(buffer), "[B%d]", key-KEY_JOYBUTTON);
 | 
			
		||||
#endif
 | 
			
		||||
    return buffer;
 | 
			
		||||
  }
 | 
			
		||||
  
 | 
			
		||||
  if (Key & 0x800)
 | 
			
		||||
  if (key & 0x800)
 | 
			
		||||
  {
 | 
			
		||||
    sprintf(buffer+strlen(buffer), "[%d]", Key & 0x7FF);
 | 
			
		||||
    sprintf(buffer+strlen(buffer), "[%d]", key & 0x7FF);
 | 
			
		||||
    return buffer;
 | 
			
		||||
  }
 | 
			
		||||
  Key = Key & 0x7FF;
 | 
			
		||||
  key = key & 0x7FF;
 | 
			
		||||
  // Touches ASCII
 | 
			
		||||
  if (Key>=' ' && Key < 127)
 | 
			
		||||
  if (key>=' ' && key < 127)
 | 
			
		||||
  {
 | 
			
		||||
    sprintf(buffer+strlen(buffer), "'%c'", toupper(Key));
 | 
			
		||||
    sprintf(buffer+strlen(buffer), "'%c'", toupper(key));
 | 
			
		||||
    return buffer;
 | 
			
		||||
  }
 | 
			
		||||
  // Touches 'World'
 | 
			
		||||
  if (Key>=SDLK_WORLD_0 && Key <= SDLK_WORLD_95)
 | 
			
		||||
  if (key>=SDLK_WORLD_0 && key <= SDLK_WORLD_95)
 | 
			
		||||
  {
 | 
			
		||||
    sprintf(buffer+strlen(buffer), "w%d", Key - SDLK_WORLD_0);
 | 
			
		||||
    sprintf(buffer+strlen(buffer), "w%d", key - SDLK_WORLD_0);
 | 
			
		||||
    return buffer;
 | 
			
		||||
  }
 | 
			
		||||
                             
 | 
			
		||||
  // Touches au libellé connu
 | 
			
		||||
  for (index=0; index < (long)sizeof(key_labels)/(long)sizeof(T_key_label);index++)
 | 
			
		||||
  {
 | 
			
		||||
    if (Key == key_labels[index].keysym)
 | 
			
		||||
    if (key == key_labels[index].keysym)
 | 
			
		||||
    {
 | 
			
		||||
      sprintf(buffer+strlen(buffer), "%s", key_labels[index].Key_name);
 | 
			
		||||
      return buffer;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  // Autres touches inconnues
 | 
			
		||||
  sprintf(buffer+strlen(buffer), "0x%X", Key & 0x7FF);
 | 
			
		||||
  sprintf(buffer+strlen(buffer), "0x%X", key & 0x7FF);
 | 
			
		||||
  return buffer;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -66,7 +66,7 @@ word Key_for_scancode(word scancode);
 | 
			
		||||
    Returns key name in a string. Used to display them in the helpscreens and in the keymapper window.
 | 
			
		||||
  @param Key keycode of the key to translate, including modifiers
 | 
			
		||||
*/
 | 
			
		||||
const char * Key_name(word Key);
 | 
			
		||||
const char * Key_name(word key);
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
  Gets the modifiers in our format from the SDL_Mod information.
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user