Support for two shortcuts per function

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@602 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Yves Rizoud 2009-02-05 22:58:13 +00:00
parent ca2e12ff00
commit 13aa8e0988
14 changed files with 468 additions and 241 deletions

View File

@ -1,9 +1,9 @@
$(OBJDIR)/aide.o: aide.c const.h struct.h global.h divers.h graph.h moteur.h \ $(OBJDIR)/aide.o: aide.c const.h struct.h global.h divers.h graph.h moteur.h \
tables_aide.h aide.h sdlscreen.h texte.h clavier.h windows.h tables_aide.h aide.h sdlscreen.h texte.h clavier.h windows.h input.h
$(OBJDIR)/boutons.o: boutons.c const.h struct.h global.h divers.h graph.h moteur.h \ $(OBJDIR)/boutons.o: boutons.c const.h struct.h global.h divers.h graph.h moteur.h \
readline.h files.h loadsave.h init.h boutons.h operatio.h pages.h \ readline.h files.h loadsave.h init.h boutons.h operatio.h pages.h \
erreurs.h readini.h saveini.h shade.h io.h aide.h texte.h sdlscreen.h \ erreurs.h readini.h saveini.h shade.h io.h aide.h texte.h sdlscreen.h \
windows.h brush.h windows.h brush.h input.h
$(OBJDIR)/brush.o: brush.c global.h struct.h const.h graph.h divers.h erreurs.h \ $(OBJDIR)/brush.o: brush.c global.h struct.h const.h graph.h divers.h erreurs.h \
windows.h sdlscreen.h windows.h sdlscreen.h
$(OBJDIR)/clavier.o: clavier.c global.h struct.h const.h $(OBJDIR)/clavier.o: clavier.c global.h struct.h const.h
@ -21,7 +21,7 @@ $(OBJDIR)/init.o: init.c const.h struct.h global.h graph.h boutons.h palette.h \
aide.h operatio.h divers.h erreurs.h clavier.h io.h hotkeys.h files.h \ aide.h operatio.h divers.h erreurs.h clavier.h io.h hotkeys.h files.h \
setup.h windows.h sdlscreen.h mountlist.h setup.h windows.h sdlscreen.h mountlist.h
$(OBJDIR)/input.o: input.c global.h struct.h const.h clavier.h graph.h sdlscreen.h \ $(OBJDIR)/input.o: input.c global.h struct.h const.h clavier.h graph.h sdlscreen.h \
windows.h erreurs.h windows.h erreurs.h divers.h input.h
$(OBJDIR)/io.o: io.c struct.h const.h io.h $(OBJDIR)/io.o: io.c struct.h const.h io.h
$(OBJDIR)/loadsave.o: loadsave.c const.h struct.h global.h graph.h divers.h pages.h \ $(OBJDIR)/loadsave.o: loadsave.c const.h struct.h global.h graph.h divers.h pages.h \
op_c.h boutons.h erreurs.h io.h sdlscreen.h windows.h loadsave.h op_c.h boutons.h erreurs.h io.h sdlscreen.h windows.h loadsave.h
@ -40,7 +40,7 @@ $(OBJDIR)/pages.o: pages.c global.h struct.h const.h pages.h graph.h erreurs.h \
divers.h windows.h divers.h windows.h
$(OBJDIR)/palette.o: palette.c const.h struct.h global.h divers.h graph.h moteur.h \ $(OBJDIR)/palette.o: palette.c const.h struct.h global.h divers.h graph.h moteur.h \
readline.h boutons.h pages.h aide.h sdlscreen.h erreurs.h op_c.h \ readline.h boutons.h pages.h aide.h sdlscreen.h erreurs.h op_c.h \
windows.h windows.h input.h
$(OBJDIR)/pxsimple.o: pxsimple.c global.h struct.h const.h sdlscreen.h divers.h $(OBJDIR)/pxsimple.o: pxsimple.c global.h struct.h const.h sdlscreen.h divers.h
$(OBJDIR)/pxtall.o: pxtall.c global.h struct.h const.h sdlscreen.h divers.h \ $(OBJDIR)/pxtall.o: pxtall.c global.h struct.h const.h sdlscreen.h divers.h \
pxsimple.h pxsimple.h

20
aide.c
View File

@ -53,23 +53,31 @@ extern char SVNRevision[];
word * Raccourci(word NumeroRaccourci) word * Raccourci(word NumeroRaccourci)
{ {
if (NumeroRaccourci & 0x100) if (NumeroRaccourci & 0x100)
return &(Bouton[NumeroRaccourci & 0xFF].Raccourci_gauche); return &(Bouton[NumeroRaccourci & 0xFF].Raccourci_gauche[0]);
if (NumeroRaccourci & 0x200) if (NumeroRaccourci & 0x200)
return &(Bouton[NumeroRaccourci & 0xFF].Raccourci_droite); return &(Bouton[NumeroRaccourci & 0xFF].Raccourci_droite[0]);
return &(Config_Touche[NumeroRaccourci & 0xFF]); return &(Config_Touche[NumeroRaccourci & 0xFF][0]);
} }
// Nom de la touche actuallement assignée à un raccourci d'après son numéro // Nom de la touche actuallement assignée à un raccourci d'après son numéro
// de type 0x100+BOUTON_* ou SPECIAL_* // de type 0x100+BOUTON_* ou SPECIAL_*
const char * Valeur_Raccourci_Clavier(word NumeroRaccourci) const char * Valeur_Raccourci_Clavier(word NumeroRaccourci)
{ {
static char Noms_raccourcis[80];
word * Pointeur = Raccourci(NumeroRaccourci); word * Pointeur = Raccourci(NumeroRaccourci);
if (Pointeur == NULL) if (Pointeur == NULL)
return "(Problem)"; return "(Problem)";
else if (*Pointeur == 0 || *Pointeur == 0xFFFF)
return "None";
else else
return Nom_touche(*Pointeur); {
if (Pointeur[0] == 0 || Pointeur[0] == 0xFFFF)
return "None";
strcpy(Noms_raccourcis, Nom_touche(Pointeur[0]));
if (Pointeur[1] == 0 || Pointeur[1] == 0xFFFF)
return Noms_raccourcis;
strcat(Noms_raccourcis, " ");
strcat(Noms_raccourcis, Nom_touche(Pointeur[1]));
return Noms_raccourcis;
}
} }

View File

@ -441,7 +441,7 @@ byte Bouton_Quitter_Routine_locale(void)
do do
{ {
Bouton_clicke=Fenetre_Bouton_clicke(); Bouton_clicke=Fenetre_Bouton_clicke();
if (Touche==Bouton[BOUTON_AIDE].Raccourci_gauche) if (Est_Raccourci(Touche,0x100+BOUTON_AIDE))
Fenetre_aide(BOUTON_QUIT, NULL); Fenetre_aide(BOUTON_QUIT, NULL);
} }
while (Bouton_clicke<=0); while (Bouton_clicke<=0);
@ -631,7 +631,7 @@ void Menu_Tag_couleurs(char * En_tete, byte * Table, byte * Mode, byte Cancel, c
Touche=0; Touche=0;
break; break;
default: default:
if (Touche==Bouton[BOUTON_AIDE].Raccourci_gauche) if (Est_Raccourci(Touche,0x100+BOUTON_AIDE))
{ {
Fenetre_aide(BOUTON_EFFETS, Section_aide); Fenetre_aide(BOUTON_EFFETS, Section_aide);
Touche=0; Touche=0;
@ -967,7 +967,7 @@ void Bouton_Settings(void)
if ((Bouton_clicke>=1) && (Bouton_clicke<=18)) if ((Bouton_clicke>=1) && (Bouton_clicke<=18))
Settings_Afficher_config(&Config_choisie); Settings_Afficher_config(&Config_choisie);
if (Touche==Bouton[BOUTON_AIDE].Raccourci_gauche) if (Est_Raccourci(Touche,0x100+BOUTON_AIDE))
Fenetre_aide(BOUTON_PARAMETRES, NULL); Fenetre_aide(BOUTON_PARAMETRES, NULL);
} }
while ( (Bouton_clicke!=18) && (Touche!=SDLK_RETURN) ); while ( (Bouton_clicke!=18) && (Touche!=SDLK_RETURN) );
@ -1194,7 +1194,7 @@ void Bouton_Copy_page(void)
do do
{ {
Bouton_clicke=Fenetre_Bouton_clicke(); Bouton_clicke=Fenetre_Bouton_clicke();
if (Touche==Bouton[BOUTON_AIDE].Raccourci_gauche) if (Est_Raccourci(Touche,0x100+BOUTON_AIDE))
Fenetre_aide(BOUTON_PAGE, NULL); Fenetre_aide(BOUTON_PAGE, NULL);
} }
while (Bouton_clicke<=0); while (Bouton_clicke<=0);
@ -1609,7 +1609,7 @@ void Bouton_Resol(void)
Touche=0; Touche=0;
break; break;
default: default:
if (Touche==Bouton[BOUTON_AIDE].Raccourci_gauche) if (Est_Raccourci(Touche,0x100+BOUTON_AIDE))
{ {
Fenetre_aide(BOUTON_RESOL, NULL); Fenetre_aide(BOUTON_RESOL, NULL);
Touche=0; Touche=0;
@ -2076,9 +2076,9 @@ void Bouton_Degrades(void)
Touche=0; Touche=0;
break; break;
default: default:
if (Touche==Bouton[BOUTON_GRADMENU].Raccourci_gauche) if (Est_Raccourci(Touche,0x100+BOUTON_AIDE))
{ {
Fenetre_aide(BOUTON_PINCEAUX, NULL); Fenetre_aide(BOUTON_GRADMENU, NULL);
Touche=0; Touche=0;
break; break;
} }
@ -2207,7 +2207,7 @@ void Bouton_Menu_pinceaux(void)
do do
{ {
Bouton_clicke=Fenetre_Bouton_clicke(); Bouton_clicke=Fenetre_Bouton_clicke();
if (Touche==Bouton[BOUTON_AIDE].Raccourci_gauche) if (Est_Raccourci(Touche,0x100+BOUTON_AIDE))
Fenetre_aide(BOUTON_PINCEAUX, NULL); Fenetre_aide(BOUTON_PINCEAUX, NULL);
} }
while (Bouton_clicke<=0); while (Bouton_clicke<=0);
@ -2949,7 +2949,7 @@ byte Bouton_Load_ou_Save(byte Load, byte Image)
default: // Autre => On se place sur le nom de fichier qui correspond default: // Autre => On se place sur le nom de fichier qui correspond
if (Bouton_clicke<=0) if (Bouton_clicke<=0)
{ {
if (Touche==Bouton[BOUTON_AIDE].Raccourci_gauche) if (Est_Raccourci(Touche,0x100+BOUTON_AIDE))
{ {
Fenetre_aide(Load?BOUTON_CHARGER:BOUTON_SAUVER, NULL); Fenetre_aide(Load?BOUTON_CHARGER:BOUTON_SAUVER, NULL);
break; break;
@ -3906,7 +3906,7 @@ void Bouton_Menu_Loupe(void)
do do
{ {
Bouton_clicke=Fenetre_Bouton_clicke(); Bouton_clicke=Fenetre_Bouton_clicke();
if (Touche==Bouton[BOUTON_AIDE].Raccourci_gauche) if (Est_Raccourci(Touche,0x100+BOUTON_AIDE))
Fenetre_aide(BOUTON_LOUPE, NULL); Fenetre_aide(BOUTON_LOUPE, NULL);
} }
while (Bouton_clicke<=0); while (Bouton_clicke<=0);
@ -4123,7 +4123,7 @@ void Bouton_Menu_Grille(void)
Afficher_curseur(); Afficher_curseur();
} }
if (Touche==Bouton[BOUTON_AIDE].Raccourci_gauche) if (Est_Raccourci(Touche,0x100+BOUTON_AIDE))
Fenetre_aide(BOUTON_EFFETS, "GRID"); Fenetre_aide(BOUTON_EFFETS, "GRID");
} }
while ( (Bouton_clicke!=1) && (Bouton_clicke!=2) ); while ( (Bouton_clicke!=1) && (Bouton_clicke!=2) );
@ -4160,28 +4160,28 @@ void Bouton_Brush_FX(void)
Fenetre_Afficher_cadre(137,83,167,53); Fenetre_Afficher_cadre(137,83,167,53);
Fenetre_Definir_bouton_normal(236,141, 67,14,"Cancel" ,0,1,TOUCHE_ESC); // 1 Fenetre_Definir_bouton_normal(236,141, 67,14,"Cancel" ,0,1,TOUCHE_ESC); // 1
Fenetre_Definir_bouton_normal( 19, 46, 27,14,"X\035" ,0,1,Config_Touche[SPECIAL_FLIP_X]); // 2 Fenetre_Definir_bouton_normal( 19, 46, 27,14,"X\035" ,0,1,Config_Touche[SPECIAL_FLIP_X][0]); // 2
Fenetre_Definir_bouton_normal( 19, 61, 27,14,"Y\022" ,0,1,Config_Touche[SPECIAL_FLIP_Y]); // 3 Fenetre_Definir_bouton_normal( 19, 61, 27,14,"Y\022" ,0,1,Config_Touche[SPECIAL_FLIP_Y][0]); // 3
Fenetre_Definir_bouton_normal( 58, 46, 37,14,"90°" ,0,1,Config_Touche[SPECIAL_ROTATE_90]); // 4 Fenetre_Definir_bouton_normal( 58, 46, 37,14,"90°" ,0,1,Config_Touche[SPECIAL_ROTATE_90][0]); // 4
Fenetre_Definir_bouton_normal( 96, 46, 37,14,"180°" ,0,1,Config_Touche[SPECIAL_ROTATE_180]); // 5 Fenetre_Definir_bouton_normal( 96, 46, 37,14,"180°" ,0,1,Config_Touche[SPECIAL_ROTATE_180][0]); // 5
Fenetre_Definir_bouton_normal( 58, 61, 75,14,"any angle" ,0,1,Config_Touche[SPECIAL_ROTATE_ANY_ANGLE]); // 6 Fenetre_Definir_bouton_normal( 58, 61, 75,14,"any angle" ,0,1,Config_Touche[SPECIAL_ROTATE_ANY_ANGLE][0]); // 6
Fenetre_Definir_bouton_normal(145, 46, 67,14,"Stretch" ,0,1,Config_Touche[SPECIAL_STRETCH]); // 7 Fenetre_Definir_bouton_normal(145, 46, 67,14,"Stretch" ,0,1,Config_Touche[SPECIAL_STRETCH][0]); // 7
Fenetre_Definir_bouton_normal(145, 61, 67,14,"Distort" ,0,1,Config_Touche[SPECIAL_DISTORT]); // 8 Fenetre_Definir_bouton_normal(145, 61, 67,14,"Distort" ,0,1,Config_Touche[SPECIAL_DISTORT][0]); // 8
Fenetre_Definir_bouton_normal(155, 99,131,14,"Recolorize" ,0,1,Config_Touche[SPECIAL_RECOLORIZE_BRUSH]); // 9 Fenetre_Definir_bouton_normal(155, 99,131,14,"Recolorize" ,0,1,Config_Touche[SPECIAL_RECOLORIZE_BRUSH][0]); // 9
Fenetre_Definir_bouton_normal(155,117,131,14,"Get brush colors",0,1,Config_Touche[SPECIAL_GET_BRUSH_COLORS]); // 10 Fenetre_Definir_bouton_normal(155,117,131,14,"Get brush colors",0,1,Config_Touche[SPECIAL_GET_BRUSH_COLORS][0]); // 10
// Boutons représentant les coins du brush handle: (HG,HD,C,BG,BD) // Boutons représentant les coins du brush handle: (HG,HD,C,BG,BD)
Fenetre_Definir_bouton_normal( 75, 90,11,11,"",0,1,Config_Touche[SPECIAL_TOP_LEFT_ATTACHMENT]); // 11 Fenetre_Definir_bouton_normal( 75, 90,11,11,"",0,1,Config_Touche[SPECIAL_TOP_LEFT_ATTACHMENT][0]); // 11
Fenetre_Definir_bouton_normal(103, 90,11,11,"",0,1,Config_Touche[SPECIAL_TOP_RIGHT_ATTACHMENT]); // 12 Fenetre_Definir_bouton_normal(103, 90,11,11,"",0,1,Config_Touche[SPECIAL_TOP_RIGHT_ATTACHMENT][0]); // 12
Fenetre_Definir_bouton_normal( 89,104,11,11,"",0,1,Config_Touche[SPECIAL_CENTER_ATTACHMENT]); // 13 Fenetre_Definir_bouton_normal( 89,104,11,11,"",0,1,Config_Touche[SPECIAL_CENTER_ATTACHMENT][0]); // 13
Fenetre_Definir_bouton_normal( 75,118,11,11,"",0,1,Config_Touche[SPECIAL_BOTTOM_LEFT_ATTACHMENT]); // 14 Fenetre_Definir_bouton_normal( 75,118,11,11,"",0,1,Config_Touche[SPECIAL_BOTTOM_LEFT_ATTACHMENT][0]); // 14
Fenetre_Definir_bouton_normal(103,118,11,11,"",0,1,Config_Touche[SPECIAL_BOTTOM_RIGHT_ATTACHMENT]); // 15 Fenetre_Definir_bouton_normal(103,118,11,11,"",0,1,Config_Touche[SPECIAL_BOTTOM_RIGHT_ATTACHMENT][0]); // 15
Fenetre_Definir_bouton_normal(224,46,67,14,"Outline",0,1,Config_Touche[SPECIAL_OUTLINE]); // 16 Fenetre_Definir_bouton_normal(224,46,67,14,"Outline",0,1,Config_Touche[SPECIAL_OUTLINE][0]); // 16
Fenetre_Definir_bouton_normal(224,61,67,14,"Nibble" ,0,1,Config_Touche[SPECIAL_NIBBLE]); // 17 Fenetre_Definir_bouton_normal(224,61,67,14,"Nibble" ,0,1,Config_Touche[SPECIAL_NIBBLE][0]); // 17
Fenetre_Definir_bouton_normal( 7,141, 60,14,"Load",0,1,Config_Touche[SPECIAL_LOAD_BRUSH]); // 18 Fenetre_Definir_bouton_normal( 7,141, 60,14,"Load",0,1,Config_Touche[SPECIAL_LOAD_BRUSH][0]); // 18
Fenetre_Definir_bouton_normal( 70,141, 60,14,"Save",0,1,Config_Touche[SPECIAL_SAVE_BRUSH]); // 19 Fenetre_Definir_bouton_normal( 70,141, 60,14,"Save",0,1,Config_Touche[SPECIAL_SAVE_BRUSH][0]); // 19
Print_dans_fenetre( 80, 24,"Shape modifications",CM_Fonce,CM_Clair); Print_dans_fenetre( 80, 24,"Shape modifications",CM_Fonce,CM_Clair);
Print_dans_fenetre( 10, 36,"Mirror",CM_Fonce,CM_Clair); Print_dans_fenetre( 10, 36,"Mirror",CM_Fonce,CM_Clair);
@ -4224,7 +4224,7 @@ void Bouton_Brush_FX(void)
do do
{ {
Bouton_clicke=Fenetre_Bouton_clicke(); Bouton_clicke=Fenetre_Bouton_clicke();
if (Touche==Bouton[BOUTON_AIDE].Raccourci_gauche) if (Est_Raccourci(Touche,0x100+BOUTON_AIDE))
{ {
Touche=0; Touche=0;
Fenetre_aide(BOUTON_EFFETS_BROSSE, NULL); Fenetre_aide(BOUTON_EFFETS_BROSSE, NULL);
@ -4410,7 +4410,7 @@ void Bouton_Smooth_Menu(void)
Afficher_curseur(); Afficher_curseur();
} }
} }
if (Touche==Bouton[BOUTON_AIDE].Raccourci_gauche) if (Est_Raccourci(Touche,0x100+BOUTON_AIDE))
Fenetre_aide(BOUTON_EFFETS, "SMOOTH"); Fenetre_aide(BOUTON_EFFETS, "SMOOTH");
} }
while ((Bouton_clicke!=1) && (Bouton_clicke!=2)); while ((Bouton_clicke!=1) && (Bouton_clicke!=2));
@ -4577,7 +4577,7 @@ void Bouton_Colorize_Menu(void)
Bouton_Colorize_Afficher_la_selection(Mode_choisi); Bouton_Colorize_Afficher_la_selection(Mode_choisi);
Afficher_curseur(); Afficher_curseur();
} }
if (Touche==Bouton[BOUTON_AIDE].Raccourci_gauche) if (Est_Raccourci(Touche,0x100+BOUTON_AIDE))
Fenetre_aide(BOUTON_EFFETS, "TRANSPARENCY"); Fenetre_aide(BOUTON_EFFETS, "TRANSPARENCY");
} }
while (Bouton_clicke<5); while (Bouton_clicke<5);
@ -4678,7 +4678,7 @@ void Bouton_Tiling_Menu(void)
} }
Afficher_curseur(); Afficher_curseur();
} }
if (Touche==Bouton[BOUTON_AIDE].Raccourci_gauche) if (Est_Raccourci(Touche,0x100+BOUTON_AIDE))
Fenetre_aide(BOUTON_EFFETS, "TILING"); Fenetre_aide(BOUTON_EFFETS, "TILING");
} }
while ( (Bouton_clicke!=1) && (Bouton_clicke!=2) ); while ( (Bouton_clicke!=1) && (Bouton_clicke!=2) );
@ -5054,7 +5054,7 @@ void Bouton_Spray_Menu(void)
Touche=0; Touche=0;
break; break;
default: default:
if (Touche==Bouton[BOUTON_AIDE].Raccourci_gauche) if (Est_Raccourci(Touche,0x100+BOUTON_AIDE))
{ {
Fenetre_aide(BOUTON_SPRAY, NULL); Fenetre_aide(BOUTON_SPRAY, NULL);
Touche=0; Touche=0;
@ -5516,7 +5516,7 @@ void Bouton_Trame_Menu(void)
Afficher_curseur(); Afficher_curseur();
Mettre_a_jour_trame(Orig_X, Orig_Y); Mettre_a_jour_trame(Orig_X, Orig_Y);
} }
if (Touche==Bouton[BOUTON_AIDE].Raccourci_gauche) if (Est_Raccourci(Touche,0x100+BOUTON_AIDE))
{ {
Touche=0; Touche=0;
Fenetre_aide(BOUTON_EFFETS, "SIEVE"); Fenetre_aide(BOUTON_EFFETS, "SIEVE");
@ -5640,16 +5640,16 @@ void Bouton_Effets(void)
Ouvrir_fenetre(270,152,"Drawing modes (effects)"); Ouvrir_fenetre(270,152,"Drawing modes (effects)");
Fenetre_Definir_bouton_normal( 7, 19, 16,16,"",0,1,Config_Touche[SPECIAL_SHADE_MODE]); // 1 Fenetre_Definir_bouton_normal( 7, 19, 16,16,"",0,1,Config_Touche[SPECIAL_SHADE_MODE][0]); // 1
Fenetre_Definir_bouton_normal( 7, 38, 16,16,"",0,1,Config_Touche[SPECIAL_QUICK_SHADE_MODE]); // 2 Fenetre_Definir_bouton_normal( 7, 38, 16,16,"",0,1,Config_Touche[SPECIAL_QUICK_SHADE_MODE][0]); // 2
Fenetre_Definir_bouton_normal( 7, 57, 16,16,"",0,1,Config_Touche[SPECIAL_COLORIZE_MODE]); // 3 Fenetre_Definir_bouton_normal( 7, 57, 16,16,"",0,1,Config_Touche[SPECIAL_COLORIZE_MODE][0]); // 3
Fenetre_Definir_bouton_normal( 7, 76, 16,16,"",0,1,Config_Touche[SPECIAL_SMOOTH_MODE]); // 4 Fenetre_Definir_bouton_normal( 7, 76, 16,16,"",0,1,Config_Touche[SPECIAL_SMOOTH_MODE][0]); // 4
Fenetre_Definir_bouton_normal( 7, 95, 16,16,"",0,1,Config_Touche[SPECIAL_SMEAR_MODE]); // 5 Fenetre_Definir_bouton_normal( 7, 95, 16,16,"",0,1,Config_Touche[SPECIAL_SMEAR_MODE][0]); // 5
Fenetre_Definir_bouton_normal(153, 19, 16,16,"",0,1,Config_Touche[SPECIAL_MASK_MODE]); // 6 Fenetre_Definir_bouton_normal(153, 19, 16,16,"",0,1,Config_Touche[SPECIAL_MASK_MODE][0]); // 6
Fenetre_Definir_bouton_normal(153, 38, 16,16,"",0,1,Config_Touche[SPECIAL_STENCIL_MODE]); // 7 Fenetre_Definir_bouton_normal(153, 38, 16,16,"",0,1,Config_Touche[SPECIAL_STENCIL_MODE][0]); // 7
Fenetre_Definir_bouton_normal(153, 57, 16,16,"",0,1,Config_Touche[SPECIAL_SIEVE_MODE]); // 8 Fenetre_Definir_bouton_normal(153, 57, 16,16,"",0,1,Config_Touche[SPECIAL_SIEVE_MODE][0]); // 8
Fenetre_Definir_bouton_normal(153, 76, 16,16,"",0,1,Config_Touche[SPECIAL_GRID_MODE]); // 9 Fenetre_Definir_bouton_normal(153, 76, 16,16,"",0,1,Config_Touche[SPECIAL_GRID_MODE][0]); // 9
Fenetre_Definir_bouton_normal(153, 95, 16,16,"",0,1,Config_Touche[SPECIAL_TILING_MODE]); // 10 Fenetre_Definir_bouton_normal(153, 95, 16,16,"",0,1,Config_Touche[SPECIAL_TILING_MODE][0]); // 10
Fenetre_Definir_bouton_normal(195,131, 68,14,"Close",0,1,SDLK_RETURN); // 11 Fenetre_Definir_bouton_normal(195,131, 68,14,"Close",0,1,SDLK_RETURN); // 11
Fenetre_Definir_bouton_normal( 7,131, 68,14,"All off",0,1,SDLK_DELETE); // 12 Fenetre_Definir_bouton_normal( 7,131, 68,14,"All off",0,1,SDLK_DELETE); // 12
Fenetre_Definir_bouton_normal( 83,131,104,14,"Feedback: ",1,1,SDLK_f); // 13 Fenetre_Definir_bouton_normal( 83,131,104,14,"Feedback: ",1,1,SDLK_f); // 13
@ -5680,7 +5680,7 @@ void Bouton_Effets(void)
Bouton_clicke=11; Bouton_clicke=11;
Touche=0; Touche=0;
} }
else if (Touche==Bouton[BOUTON_AIDE].Raccourci_gauche) else if (Est_Raccourci(Touche,0x100+BOUTON_AIDE))
{ {
Touche=0; Touche=0;
// Aide contextuelle // Aide contextuelle
@ -6193,7 +6193,7 @@ void Bouton_Texte()
Scroller_de_fontes->Position=Debut_liste; Scroller_de_fontes->Position=Debut_liste;
Fenetre_Dessiner_jauge(Scroller_de_fontes); Fenetre_Dessiner_jauge(Scroller_de_fontes);
} }
if (Touche==Bouton[BOUTON_AIDE].Raccourci_gauche) if (Est_Raccourci(Touche,0x100+BOUTON_AIDE))
Fenetre_aide(BOUTON_TEXTE, NULL); Fenetre_aide(BOUTON_TEXTE, NULL);
} }
switch(Bouton_clicke) switch(Bouton_clicke)

View File

@ -421,7 +421,10 @@ const char * Nom_touche(word Touche)
{ SDLK_MENU , "Menu" }, { SDLK_MENU , "Menu" },
{ SDLK_POWER , "Power" }, { SDLK_POWER , "Power" },
{ SDLK_EURO , "Euro" }, { SDLK_EURO , "Euro" },
{ SDLK_UNDO , "Undo" } { SDLK_UNDO , "Undo" },
{ TOUCHE_MOUSEMIDDLE, "Mouse3" },
{ TOUCHE_MOUSEWHEELUP, "WheelUp" },
{ TOUCHE_MOUSEWHEELDOWN, "WheelDown" }
}; };
int Indice; int Indice;
@ -434,7 +437,13 @@ const char * Nom_touche(word Touche)
strcat(Buffer, "Alt+"); strcat(Buffer, "Alt+");
if (Touche & MOD_SHIFT) if (Touche & MOD_SHIFT)
strcat(Buffer, "Shift+"); strcat(Buffer, "Shift+");
if (Touche>=TOUCHE_BUTTON && Touche<=TOUCHE_BUTTON+18)
{
sprintf(Buffer+strlen(Buffer), "[B%d]", Touche);
return Buffer;
}
if (Touche & 0x8000) if (Touche & 0x8000)
{ {
sprintf(Buffer+strlen(Buffer), "[%d]", Touche & 0xFFF); sprintf(Buffer+strlen(Buffer), "[%d]", Touche & 0xFFF);

View File

@ -31,7 +31,7 @@
#define POURCENTAGE_VERSION "98.0%" // Libellé du pourcentage de la version ß #define POURCENTAGE_VERSION "98.0%" // Libellé du pourcentage de la version ß
#define VERSION1 2 // | #define VERSION1 2 // |
#define VERSION2 0 // |_ Numéro de version découpé en #define VERSION2 0 // |_ Numéro de version découpé en
#define BETA1 97 // | plusieurs parties => 2.0 ß95.5% #define BETA1 98 // | plusieurs parties => 2.0 ß95.5%
#define BETA2 0 // | (utilisé pour le fichier de config) #define BETA2 0 // | (utilisé pour le fichier de config)
#define ALPHA_BETA "ß" // Type de la version "Þ" ou "ß" #define ALPHA_BETA "ß" // Type de la version "Þ" ou "ß"
#define MAX_MODES_VIDEO 100 // Nombre de modes vidéo maxi #define MAX_MODES_VIDEO 100 // Nombre de modes vidéo maxi

View File

@ -42,6 +42,17 @@
#define MOD_CTRL 0x2000 #define MOD_CTRL 0x2000
#define MOD_ALT 0x4000 #define MOD_ALT 0x4000
#define TOUCHE_MOUSEMIDDLE (SDLK_LAST+1)
#define TOUCHE_MOUSEWHEELUP (SDLK_LAST+2)
#define TOUCHE_MOUSEWHEELDOWN (SDLK_LAST+3)
#define TOUCHE_BUTTON (SDLK_LAST+4)
#ifdef __gp2x__
#define TOUCHE_ESC (TOUCHE_BUTTON+GP2X_BUTTON_X)
#else
#define TOUCHE_ESC SDLK_ESCAPE
#endif
#include "struct.h" #include "struct.h"
#include "clavier.h" #include "clavier.h"
#include "const.h" #include "const.h"
@ -640,7 +651,7 @@ void Enregistrer_config()
{ {
write_word_le(Fichier,ConfigTouche[Indice_touche].Numero); write_word_le(Fichier,ConfigTouche[Indice_touche].Numero);
write_word_le(Fichier,ConfigTouche[Indice_touche].Touche); write_word_le(Fichier,ConfigTouche[Indice_touche].Touche);
write_word_le(Fichier,0xFF); write_word_le(Fichier,ConfigTouche[Indice_touche].Touche2);
} }
} }
else else

View File

@ -83,7 +83,7 @@ GFX2_GLOBAL struct S_Config
} Config; } Config;
// Tableau des touches spéciales // Tableau des touches spéciales
GFX2_GLOBAL word Config_Touche[NB_TOUCHES_SPECIALES]; GFX2_GLOBAL word Config_Touche[NB_TOUCHES_SPECIALES][2];
struct S_Mode_video struct S_Mode_video
@ -391,8 +391,8 @@ GFX2_GLOBAL struct
// Information sur les clicks de la souris: // Information sur les clicks de la souris:
fonction_action Gauche; // Action déclenchée par un click gauche sur le bouton fonction_action Gauche; // Action déclenchée par un click gauche sur le bouton
fonction_action Droite; // Action déclenchée par un click droit sur le bouton fonction_action Droite; // Action déclenchée par un click droit sur le bouton
word Raccourci_gauche; // Raccourci clavier équivalent à un click gauche sur le bouton word Raccourci_gauche[2]; // Raccourci clavier équivalent à un click gauche sur le bouton
word Raccourci_droite; // Raccourci clavier équivalent à un click droit sur le bouton word Raccourci_droite[2]; // Raccourci clavier équivalent à un click droit sur le bouton
// Informations sur le désenclenchement du bouton géré par le moteur: // Informations sur le désenclenchement du bouton géré par le moteur:
fonction_action Desenclencher; // Action appelée lors du désenclenchement du bouton fonction_action Desenclencher; // Action appelée lors du désenclenchement du bouton

403
hotkeys.h

File diff suppressed because it is too large Load Diff

58
init.c
View File

@ -886,8 +886,10 @@ void Initialisation_des_boutons(void)
for (Indice_bouton=0;Indice_bouton<NB_BOUTONS;Indice_bouton++) for (Indice_bouton=0;Indice_bouton<NB_BOUTONS;Indice_bouton++)
{ {
Bouton[Indice_bouton].Raccourci_gauche=0xFFFF; Bouton[Indice_bouton].Raccourci_gauche[0]=0xFFFF;
Bouton[Indice_bouton].Raccourci_droite=0xFFFF; Bouton[Indice_bouton].Raccourci_gauche[1]=0xFFFF;
Bouton[Indice_bouton].Raccourci_droite[0]=0xFFFF;
Bouton[Indice_bouton].Raccourci_droite[1]=0xFFFF;
Initialiser_bouton(Indice_bouton, Initialiser_bouton(Indice_bouton,
0,0, 0,0,
1,1, 1,1,
@ -1944,6 +1946,14 @@ int Charger_CFG(int Tout_charger)
// Les touches (scancodes) sont à convertir) // Les touches (scancodes) sont à convertir)
Conversion_touches = 1; Conversion_touches = 1;
} }
// Version SDL jusqu'a 98%
else if ( (CFG_Header.Version1== 2)
&& (CFG_Header.Version2== 0)
&& (CFG_Header.Beta1== 97))
{
// Les touches 00FF (pas de touche) sont a comprendre comme 0xFFFF
Conversion_touches = 2;
}
// Version SDL // Version SDL
else if ( (CFG_Header.Version1!=VERSION1) else if ( (CFG_Header.Version1!=VERSION1)
|| (CFG_Header.Version2!=VERSION2) || (CFG_Header.Version2!=VERSION2)
@ -1968,10 +1978,18 @@ int Charger_CFG(int Tout_charger)
goto Erreur_lecture_config; goto Erreur_lecture_config;
else else
{ {
if (Conversion_touches) if (Conversion_touches==1)
{ {
CFG_Infos_touche.Touche = Touche_pour_scancode(CFG_Infos_touche.Touche); CFG_Infos_touche.Touche = Touche_pour_scancode(CFG_Infos_touche.Touche);
} }
else if (Conversion_touches==2)
{
if (CFG_Infos_touche.Touche == 0x00FF)
CFG_Infos_touche.Touche = 0xFFFF;
if (CFG_Infos_touche.Touche2 == 0x00FF)
CFG_Infos_touche.Touche2 = 0xFFFF;
}
for (Indice2=0; for (Indice2=0;
((Indice2<NB_TOUCHES) && (ConfigTouche[Indice2].Numero!=CFG_Infos_touche.Numero)); ((Indice2<NB_TOUCHES) && (ConfigTouche[Indice2].Numero!=CFG_Infos_touche.Numero));
Indice2++); Indice2++);
@ -1980,13 +1998,16 @@ int Charger_CFG(int Tout_charger)
switch(Ordonnancement[Indice2]>>8) switch(Ordonnancement[Indice2]>>8)
{ {
case 0 : case 0 :
Config_Touche[Ordonnancement[Indice2]&0xFF]=CFG_Infos_touche.Touche; Config_Touche[Ordonnancement[Indice2]&0xFF][0]=CFG_Infos_touche.Touche;
Config_Touche[Ordonnancement[Indice2]&0xFF][1]=CFG_Infos_touche.Touche2;
break; break;
case 1 : case 1 :
Bouton[Ordonnancement[Indice2]&0xFF].Raccourci_gauche = CFG_Infos_touche.Touche; Bouton[Ordonnancement[Indice2]&0xFF].Raccourci_gauche[0] = CFG_Infos_touche.Touche;
Bouton[Ordonnancement[Indice2]&0xFF].Raccourci_gauche[1] = CFG_Infos_touche.Touche2;
break; break;
case 2 : case 2 :
Bouton[Ordonnancement[Indice2]&0xFF].Raccourci_droite = CFG_Infos_touche.Touche; Bouton[Ordonnancement[Indice2]&0xFF].Raccourci_droite[0] = CFG_Infos_touche.Touche;
Bouton[Ordonnancement[Indice2]&0xFF].Raccourci_droite[1] = CFG_Infos_touche.Touche2;
break; break;
} }
} }
@ -2220,11 +2241,19 @@ int Sauver_CFG(void)
CFG_Infos_touche.Numero = ConfigTouche[Indice].Numero; CFG_Infos_touche.Numero = ConfigTouche[Indice].Numero;
switch(Ordonnancement[Indice]>>8) switch(Ordonnancement[Indice]>>8)
{ {
case 0 : CFG_Infos_touche.Touche=Config_Touche[Ordonnancement[Indice]&0xFF]; break; case 0 :
case 1 : CFG_Infos_touche.Touche=Bouton[Ordonnancement[Indice]&0xFF].Raccourci_gauche; break; CFG_Infos_touche.Touche =Config_Touche[Ordonnancement[Indice]&0xFF][0];
case 2 : CFG_Infos_touche.Touche=Bouton[Ordonnancement[Indice]&0xFF].Raccourci_droite; break; CFG_Infos_touche.Touche2=Config_Touche[Ordonnancement[Indice]&0xFF][1];
break;
case 1 :
CFG_Infos_touche.Touche =Bouton[Ordonnancement[Indice]&0xFF].Raccourci_gauche[0];
CFG_Infos_touche.Touche2=Bouton[Ordonnancement[Indice]&0xFF].Raccourci_gauche[1];
break;
case 2 :
CFG_Infos_touche.Touche =Bouton[Ordonnancement[Indice]&0xFF].Raccourci_droite[0];
CFG_Infos_touche.Touche2=Bouton[Ordonnancement[Indice]&0xFF].Raccourci_droite[1];
break;
} }
CFG_Infos_touche.Touche2=0x00FF;
if (!write_word_le(Handle, CFG_Infos_touche.Numero) || if (!write_word_le(Handle, CFG_Infos_touche.Numero) ||
!write_word_le(Handle, CFG_Infos_touche.Touche) || !write_word_le(Handle, CFG_Infos_touche.Touche) ||
!write_word_le(Handle, CFG_Infos_touche.Touche2) ) !write_word_le(Handle, CFG_Infos_touche.Touche2) )
@ -2399,13 +2428,16 @@ void Config_par_defaut(void)
switch(Ordonnancement[Indice]>>8) switch(Ordonnancement[Indice]>>8)
{ {
case 0 : case 0 :
Config_Touche[Ordonnancement[Indice]&0xFF]=ConfigTouche[Indice].Touche; Config_Touche[Ordonnancement[Indice]&0xFF][0]=ConfigTouche[Indice].Touche;
Config_Touche[Ordonnancement[Indice]&0xFF][1]=ConfigTouche[Indice].Touche2;
break; break;
case 1 : case 1 :
Bouton[Ordonnancement[Indice]&0xFF].Raccourci_gauche = ConfigTouche[Indice].Touche; Bouton[Ordonnancement[Indice]&0xFF].Raccourci_gauche[0] = ConfigTouche[Indice].Touche;
Bouton[Ordonnancement[Indice]&0xFF].Raccourci_gauche[1] = ConfigTouche[Indice].Touche2;
break; break;
case 2 : case 2 :
Bouton[Ordonnancement[Indice]&0xFF].Raccourci_droite = ConfigTouche[Indice].Touche; Bouton[Ordonnancement[Indice]&0xFF].Raccourci_droite[0] = ConfigTouche[Indice].Touche;
Bouton[Ordonnancement[Indice]&0xFF].Raccourci_droite[1] = ConfigTouche[Indice].Touche2;
break; break;
} }
} }

76
input.c
View File

@ -52,6 +52,30 @@ short Button_alt=-1; // Button number that serves as a "alt" modifier
short Button_clic_gauche=0; // Button number that serves as left click short Button_clic_gauche=0; // Button number that serves as left click
short Button_clic_droit=0; // Button number that serves as right-click short Button_clic_droit=0; // Button number that serves as right-click
int Est_Raccourci(word Touche, word Fonction)
{
if (Fonction & 0x100)
{
if (Bouton[Fonction&0xFF].Raccourci_gauche[0]==Touche)
return 1;
if (Bouton[Fonction&0xFF].Raccourci_gauche[1]==Touche)
return 1;
return 0;
}
if (Fonction & 0x200)
{
if (Bouton[Fonction&0xFF].Raccourci_droite[0]==Touche)
return 1;
if (Bouton[Fonction&0xFF].Raccourci_droite[1]==Touche)
return 1;
return 0;
}
if(Touche == Config_Touche[Fonction][0])
return 1;
if(Touche == Config_Touche[Fonction][1])
return 1;
return 0;
}
// Called each time there is a cursor move, either triggered by mouse or keyboard shortcuts // Called each time there is a cursor move, either triggered by mouse or keyboard shortcuts
int Move_cursor_with_constraints() int Move_cursor_with_constraints()
@ -210,32 +234,32 @@ int Handle_Key_Press(SDL_KeyboardEvent event)
Touche = Conversion_Touche(event.keysym); Touche = Conversion_Touche(event.keysym);
Touche_ANSI = Conversion_ANSI(event.keysym); Touche_ANSI = Conversion_ANSI(event.keysym);
if(Touche == Config_Touche[SPECIAL_MOUSE_UP]) if(Est_Raccourci(Touche,SPECIAL_MOUSE_UP))
{ {
Directional_up=1; Directional_up=1;
return 0; return 0;
} }
else if(Touche == Config_Touche[SPECIAL_MOUSE_DOWN]) else if(Est_Raccourci(Touche,SPECIAL_MOUSE_DOWN))
{ {
Directional_down=1; Directional_down=1;
return 0; return 0;
} }
else if(Touche == Config_Touche[SPECIAL_MOUSE_LEFT]) else if(Est_Raccourci(Touche,SPECIAL_MOUSE_LEFT))
{ {
Directional_left=1; Directional_left=1;
return 0; return 0;
} }
else if(Touche == Config_Touche[SPECIAL_MOUSE_RIGHT]) else if(Est_Raccourci(Touche,SPECIAL_MOUSE_RIGHT))
{ {
Directional_right=1; Directional_right=1;
return 0; return 0;
} }
else if(Touche == Config_Touche[SPECIAL_CLICK_LEFT]) else if(Est_Raccourci(Touche,SPECIAL_CLICK_LEFT))
{ {
INPUT_Nouveau_Mouse_K=1; INPUT_Nouveau_Mouse_K=1;
return Move_cursor_with_constraints(); return Move_cursor_with_constraints();
} }
else if(Touche == Config_Touche[SPECIAL_CLICK_RIGHT]) else if(Est_Raccourci(Touche,SPECIAL_CLICK_RIGHT))
{ {
INPUT_Nouveau_Mouse_K=2; INPUT_Nouveau_Mouse_K=2;
return Move_cursor_with_constraints(); return Move_cursor_with_constraints();
@ -252,16 +276,16 @@ int Handle_Key_Press(SDL_KeyboardEvent event)
//supportant le changement de couleur ou de taille de pinceau. //supportant le changement de couleur ou de taille de pinceau.
if( if(
(Touche != Config_Touche[SPECIAL_NEXT_FORECOLOR]) && (!Est_Raccourci(Touche,SPECIAL_NEXT_FORECOLOR)) &&
(Touche != Config_Touche[SPECIAL_PREVIOUS_FORECOLOR]) && (!Est_Raccourci(Touche,SPECIAL_PREVIOUS_FORECOLOR)) &&
(Touche != Config_Touche[SPECIAL_NEXT_BACKCOLOR]) && (!Est_Raccourci(Touche,SPECIAL_NEXT_BACKCOLOR)) &&
(Touche != Config_Touche[SPECIAL_PREVIOUS_BACKCOLOR]) && (!Est_Raccourci(Touche,SPECIAL_PREVIOUS_BACKCOLOR)) &&
(Touche != Config_Touche[SPECIAL_RETRECIR_PINCEAU]) && (!Est_Raccourci(Touche,SPECIAL_RETRECIR_PINCEAU)) &&
(Touche != Config_Touche[SPECIAL_GROSSIR_PINCEAU]) && (!Est_Raccourci(Touche,SPECIAL_GROSSIR_PINCEAU)) &&
(Touche != Config_Touche[SPECIAL_NEXT_USER_FORECOLOR]) && (!Est_Raccourci(Touche,SPECIAL_NEXT_USER_FORECOLOR)) &&
(Touche != Config_Touche[SPECIAL_PREVIOUS_USER_FORECOLOR]) && (!Est_Raccourci(Touche,SPECIAL_PREVIOUS_USER_FORECOLOR)) &&
(Touche != Config_Touche[SPECIAL_NEXT_USER_BACKCOLOR]) && (!Est_Raccourci(Touche,SPECIAL_NEXT_USER_BACKCOLOR)) &&
(Touche != Config_Touche[SPECIAL_PREVIOUS_USER_BACKCOLOR]) (!Est_Raccourci(Touche,SPECIAL_PREVIOUS_USER_BACKCOLOR))
) )
{ {
Touche=0; Touche=0;
@ -276,28 +300,34 @@ int Handle_Key_Press(SDL_KeyboardEvent event)
int Relache_controle(int CodeTouche, int Modifieur) int Relache_controle(int CodeTouche, int Modifieur)
{ {
if(CodeTouche == (Config_Touche[SPECIAL_MOUSE_UP]&0x0FFF) || (Config_Touche[SPECIAL_MOUSE_UP]&Modifieur)) if(CodeTouche == (Config_Touche[SPECIAL_MOUSE_UP][0]&0x0FFF) || (Config_Touche[SPECIAL_MOUSE_UP][0]&Modifieur) ||
CodeTouche == (Config_Touche[SPECIAL_MOUSE_UP][1]&0x0FFF) || (Config_Touche[SPECIAL_MOUSE_UP][1]&Modifieur))
{ {
Directional_up=0; Directional_up=0;
} }
if(CodeTouche == (Config_Touche[SPECIAL_MOUSE_DOWN]&0x0FFF) || (Config_Touche[SPECIAL_MOUSE_DOWN]&Modifieur)) if(CodeTouche == (Config_Touche[SPECIAL_MOUSE_DOWN][0]&0x0FFF) || (Config_Touche[SPECIAL_MOUSE_DOWN][0]&Modifieur) ||
CodeTouche == (Config_Touche[SPECIAL_MOUSE_DOWN][1]&0x0FFF) || (Config_Touche[SPECIAL_MOUSE_DOWN][1]&Modifieur))
{ {
Directional_down=0; Directional_down=0;
} }
if(CodeTouche == (Config_Touche[SPECIAL_MOUSE_LEFT]&0x0FFF) || (Config_Touche[SPECIAL_MOUSE_LEFT]&Modifieur)) if(CodeTouche == (Config_Touche[SPECIAL_MOUSE_LEFT][0]&0x0FFF) || (Config_Touche[SPECIAL_MOUSE_LEFT][0]&Modifieur) ||
CodeTouche == (Config_Touche[SPECIAL_MOUSE_LEFT][1]&0x0FFF) || (Config_Touche[SPECIAL_MOUSE_LEFT][1]&Modifieur))
{ {
Directional_left=0; Directional_left=0;
} }
if(CodeTouche == (Config_Touche[SPECIAL_MOUSE_RIGHT]&0x0FFF) || (Config_Touche[SPECIAL_MOUSE_RIGHT]&Modifieur)) if(CodeTouche == (Config_Touche[SPECIAL_MOUSE_RIGHT][0]&0x0FFF) || (Config_Touche[SPECIAL_MOUSE_RIGHT][0]&Modifieur) ||
CodeTouche == (Config_Touche[SPECIAL_MOUSE_RIGHT][1]&0x0FFF) || (Config_Touche[SPECIAL_MOUSE_RIGHT][1]&Modifieur))
{ {
Directional_right=0; Directional_right=0;
} }
if(CodeTouche == (Config_Touche[SPECIAL_CLICK_LEFT]&0x0FFF) || (Config_Touche[SPECIAL_CLICK_LEFT]&Modifieur)) if(CodeTouche == (Config_Touche[SPECIAL_CLICK_LEFT][0]&0x0FFF) || (Config_Touche[SPECIAL_CLICK_LEFT][0]&Modifieur) ||
CodeTouche == (Config_Touche[SPECIAL_CLICK_LEFT][1]&0x0FFF) || (Config_Touche[SPECIAL_CLICK_LEFT][1]&Modifieur))
{ {
INPUT_Nouveau_Mouse_K &= ~1; INPUT_Nouveau_Mouse_K &= ~1;
return Move_cursor_with_constraints(); return Move_cursor_with_constraints();
} }
if(CodeTouche == (Config_Touche[SPECIAL_CLICK_RIGHT]&0x0FFF) || (Config_Touche[SPECIAL_CLICK_RIGHT]&Modifieur)) if(CodeTouche == (Config_Touche[SPECIAL_CLICK_RIGHT][0]&0x0FFF) || (Config_Touche[SPECIAL_CLICK_RIGHT][0]&Modifieur) ||
CodeTouche == (Config_Touche[SPECIAL_CLICK_RIGHT][1]&0x0FFF) || (Config_Touche[SPECIAL_CLICK_RIGHT][1]&Modifieur))
{ {
INPUT_Nouveau_Mouse_K &= ~2; INPUT_Nouveau_Mouse_K &= ~2;
return Move_cursor_with_constraints(); return Move_cursor_with_constraints();
@ -605,7 +635,7 @@ int Get_input(void)
break; break;
default: default:
DEBUG("Unhandled SDL event number : ",event.type); // DEBUG("Unhandled SDL event number : ",event.type);
break; break;
} }
} }

View File

@ -21,3 +21,4 @@
void Gere_Evenement_SDL(SDL_Event * event); void Gere_Evenement_SDL(SDL_Event * event);
int Get_input(void); int Get_input(void);
int Est_Raccourci(word Touche, word Fonction);

View File

@ -535,7 +535,7 @@ void Gestion_principale(void)
// Gestion des touches // Gestion des touches
if (Touche) if (Touche)
{ {
for (Indice_Touche=0;(Indice_Touche<NB_TOUCHES_SPECIALES) && (Touche!=Config_Touche[Indice_Touche]);Indice_Touche++); for (Indice_Touche=0;(Indice_Touche<NB_TOUCHES_SPECIALES) && (Touche!=Config_Touche[Indice_Touche][0]) && (Touche!=Config_Touche[Indice_Touche][1]);Indice_Touche++);
// Gestion des touches spéciales: // Gestion des touches spéciales:
if (Indice_Touche>SPECIAL_CLICK_RIGHT) if (Indice_Touche>SPECIAL_CLICK_RIGHT)
@ -901,13 +901,13 @@ void Gestion_principale(void)
Bouton_Touche=-1; Bouton_Touche=-1;
for (Indice_bouton=0;Indice_bouton<NB_BOUTONS;Indice_bouton++) for (Indice_bouton=0;Indice_bouton<NB_BOUTONS;Indice_bouton++)
{ {
if (Touche==Bouton[Indice_bouton].Raccourci_gauche) if (Est_Raccourci(Touche,0x100+Indice_bouton))
{ {
Bouton_Touche=Indice_bouton; Bouton_Touche=Indice_bouton;
Bouton_Cote =A_GAUCHE; Bouton_Cote =A_GAUCHE;
Indice_bouton=NB_BOUTONS; Indice_bouton=NB_BOUTONS;
} }
else if (Touche==Bouton[Indice_bouton].Raccourci_droite) else if (Est_Raccourci(Touche,0x200+Indice_bouton))
{ {
Bouton_Touche=Indice_bouton; Bouton_Touche=Indice_bouton;
Bouton_Cote =A_DROITE; Bouton_Cote =A_DROITE;

View File

@ -35,6 +35,7 @@
#include "erreurs.h" #include "erreurs.h"
#include "op_c.h" #include "op_c.h"
#include "windows.h" #include "windows.h"
#include "input.h"
byte Palette_mode_RGB = 1; // Indique si on est en HSL ou en RGB byte Palette_mode_RGB = 1; // Indique si on est en HSL ou en RGB
@ -2005,7 +2006,7 @@ void Bouton_Palette(void)
Touche=0; Touche=0;
break; break;
default: default:
if (Touche==Bouton[BOUTON_AIDE].Raccourci_gauche) if (Est_Raccourci(Touche,0x100+BOUTON_AIDE))
{ {
Touche=0; Touche=0;
Fenetre_aide(BOUTON_PALETTE, NULL); Fenetre_aide(BOUTON_PALETTE, NULL);
@ -2096,7 +2097,7 @@ void Bouton_Palette_secondaire(void)
do do
{ {
Bouton_clicke=Fenetre_Bouton_clicke(); Bouton_clicke=Fenetre_Bouton_clicke();
if (Touche==Bouton[BOUTON_AIDE].Raccourci_gauche) if (Est_Raccourci(Touche,0x100+BOUTON_AIDE))
{ {
Touche=0; Touche=0;
Fenetre_aide(BOUTON_PALETTE, NULL); Fenetre_aide(BOUTON_PALETTE, NULL);

View File

@ -975,7 +975,7 @@ int Menu_Shade(void)
Touche=0; Touche=0;
break; break;
default: default:
if (Touche==Bouton[BOUTON_AIDE].Raccourci_gauche) if (Est_Raccourci(Touche,0x100+BOUTON_AIDE))
{ {
Touche=0; Touche=0;
Fenetre_aide(BOUTON_EFFETS, "SHADE"); Fenetre_aide(BOUTON_EFFETS, "SHADE");
@ -1090,7 +1090,7 @@ void Bouton_Quick_shade_Menu(void)
Quick_shade_Step=Temp; Quick_shade_Step=Temp;
Afficher_curseur(); Afficher_curseur();
} }
if (Touche==Bouton[BOUTON_AIDE].Raccourci_gauche) if (Est_Raccourci(Touche,0x100+BOUTON_AIDE))
Fenetre_aide(BOUTON_EFFETS, "QUICK SHADE"); Fenetre_aide(BOUTON_EFFETS, "QUICK SHADE");
} }
while ((Bouton_clicke!=1) && (Bouton_clicke!=2)); while ((Bouton_clicke!=1) && (Bouton_clicke!=2));