From 9d428e1e381fcc279b4622a59a7a95d1d13cbb3a Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Sat, 7 Feb 2009 23:36:11 +0000 Subject: [PATCH] Keyboard shortcuts are customizable from within Grafx2. 2 shortcuts per function. You can use keys, MouseWheel, Middlebutton, joystick buttons, in combination with Alt, Shift, Control. git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@609 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- Makefile | 4 +- aide.c | 174 ++++++++- clavier.c | 32 +- clavier.h | 1 + global.h | 1 + hotkeys.h | 956 +------------------------------------------------- init.c | 141 -------- input.c | 8 +- tables_aide.h | 9 +- windows.c | 2 +- windows.h | 2 +- 11 files changed, 222 insertions(+), 1108 deletions(-) diff --git a/Makefile b/Makefile index d1ab299b..af70ff0f 100644 --- a/Makefile +++ b/Makefile @@ -220,8 +220,8 @@ endif .PHONY : all debug release clean depend zip version force install uninstall -OBJ = $(OBJDIR)/main.o $(OBJDIR)/init.o $(OBJDIR)/graph.o $(OBJDIR)/sdlscreen.o $(OBJDIR)/divers.o $(OBJDIR)/special.o $(OBJDIR)/boutons.o $(OBJDIR)/palette.o $(OBJDIR)/aide.o $(OBJDIR)/operatio.o $(OBJDIR)/pages.o $(OBJDIR)/loadsave.o $(OBJDIR)/readline.o $(OBJDIR)/moteur.o $(OBJDIR)/files.o $(OBJDIR)/op_c.o $(OBJDIR)/readini.o $(OBJDIR)/saveini.o $(OBJDIR)/shade.o $(OBJDIR)/clavier.o $(OBJDIR)/io.o $(OBJDIR)/version.o $(OBJDIR)/texte.o $(OBJDIR)/SFont.o $(OBJDIR)/setup.o $(OBJDIR)/pxsimple.o $(OBJDIR)/pxtall.o $(OBJDIR)/pxwide.o $(OBJDIR)/windows.o $(OBJDIR)/brush.o $(OBJDIR)/realpath.o $(OBJDIR)/mountlist.o $(OBJDIR)/input.o -CFGOBJ = $(OBJDIR)/gfxcfg.o $(OBJDIR)/SFont.o $(OBJDIR)/clavier.o $(OBJDIR)/io.o $(OBJDIR)/setup.o +OBJ = $(OBJDIR)/main.o $(OBJDIR)/init.o $(OBJDIR)/graph.o $(OBJDIR)/sdlscreen.o $(OBJDIR)/divers.o $(OBJDIR)/special.o $(OBJDIR)/boutons.o $(OBJDIR)/palette.o $(OBJDIR)/aide.o $(OBJDIR)/operatio.o $(OBJDIR)/pages.o $(OBJDIR)/loadsave.o $(OBJDIR)/readline.o $(OBJDIR)/moteur.o $(OBJDIR)/files.o $(OBJDIR)/op_c.o $(OBJDIR)/readini.o $(OBJDIR)/saveini.o $(OBJDIR)/shade.o $(OBJDIR)/clavier.o $(OBJDIR)/io.o $(OBJDIR)/version.o $(OBJDIR)/texte.o $(OBJDIR)/SFont.o $(OBJDIR)/setup.o $(OBJDIR)/pxsimple.o $(OBJDIR)/pxtall.o $(OBJDIR)/pxwide.o $(OBJDIR)/windows.o $(OBJDIR)/brush.o $(OBJDIR)/realpath.o $(OBJDIR)/mountlist.o $(OBJDIR)/input.o $(OBJDIR)/hotkeys.o +CFGOBJ = $(OBJDIR)/gfxcfg.o $(OBJDIR)/SFont.o $(OBJDIR)/clavier.o $(OBJDIR)/io.o $(OBJDIR)/setup.o $(OBJDIR)/hotkeys.o all : $(BIN) $(CFGBIN) diff --git a/aide.c b/aide.c index c100f54e..039277ad 100644 --- a/aide.c +++ b/aide.c @@ -46,6 +46,8 @@ #include "clavier.h" #include "windows.h" #include "input.h" +#include "hotkeys.h" +#include "erreurs.h" extern char SVNRevision[]; @@ -77,12 +79,156 @@ const char * Valeur_Raccourci_Clavier(word NumeroRaccourci) return Nom_touche(Pointeur[1]); strcpy(Noms_raccourcis, Nom_touche(Pointeur[0])); - strcat(Noms_raccourcis, " "); + strcat(Noms_raccourcis, " or "); strcat(Noms_raccourcis, Nom_touche(Pointeur[1])); return Noms_raccourcis; } } +void Redefinir_controle(word *Raccourci, int Pos_X, int Pos_Y) +{ + Effacer_curseur(); + Print_dans_fenetre(Pos_X,Pos_Y,"*PRESS KEY OR BUTTON*",CM_Noir,CM_Clair); + Afficher_curseur(); + while (1) + { + while(!Get_input())Wait_VBL(); + if (Touche==TOUCHE_ESC) + return; + if (Touche!=0) + { + *Raccourci=Touche; + return; + } + } +} +void Fenetre_controle(int NumeroControle) +{ + short Bouton_clicke; + short IndiceOrdo; + short IndiceConfig; + short Redessiner_controles=1; + word * PtrRaccourci=NULL; + word Sauve_raccourci[2]; + + PtrRaccourci=Raccourci(NumeroControle); + + Sauve_raccourci[0]=PtrRaccourci[0]; + Sauve_raccourci[1]=PtrRaccourci[1]; + + // Recherche dans hotkeys + IndiceOrdo=0; + while (Ordonnancement[IndiceOrdo]!=NumeroControle) + { + IndiceOrdo++; + if (IndiceOrdo>=134) + { + Erreur(0); + return; + } + } + /* + IndiceConfig=0; + while (ConfigTouche[IndiceConfig].Numero!=IndiceOrdo) + { + IndiceConfig++; + if (IndiceConfig>=134) + { + Erreur(0); + return; + } + } + */ + IndiceConfig=IndiceOrdo; // Comprends pas... ça devrait pas marcher + + Ouvrir_fenetre(302,131,"Keyboard shortcut"); + Fenetre_Definir_bouton_normal(181,111,55,14,"Cancel",0,1,TOUCHE_ESC); // 1 + Fenetre_Definir_bouton_normal(241,111,55,14,"OK",0,1,SDLK_RETURN); // 2 + + Fenetre_Definir_bouton_normal(6,111,111,14,"Reset default",0,1,TOUCHE_AUCUNE); // 3 + + // Titre + Block(Fenetre_Pos_X+(Menu_Facteur_X*5), + Fenetre_Pos_Y+(Menu_Facteur_Y*16), + Menu_Facteur_X*292,Menu_Facteur_Y*11,CM_Noir); + Print_dans_fenetre(7,18,ConfigTouche[IndiceConfig].Libelle,CM_Blanc,CM_Noir); + + // Zone de description + Fenetre_Afficher_cadre_creux(5,68,292,37); + Print_dans_fenetre(9,70,ConfigTouche[IndiceConfig].Explic1,CM_Noir,CM_Clair); + Print_dans_fenetre(9,78,ConfigTouche[IndiceConfig].Explic2,CM_Noir,CM_Clair); + Print_dans_fenetre(9,86,ConfigTouche[IndiceConfig].Explic3,CM_Noir,CM_Clair); + + // Raccourci 0 + Fenetre_Definir_bouton_normal(27,30,177,14,"",0,1,TOUCHE_AUCUNE); // 4 + Fenetre_Definir_bouton_normal(209,30,56,14,"Remove",0,1,TOUCHE_AUCUNE); // 5 + + // Raccourci 1 + Fenetre_Definir_bouton_normal(27,49,177,14,"",0,1,TOUCHE_AUCUNE); // 6 + Fenetre_Definir_bouton_normal(209,49,56,14,"Remove",0,1,TOUCHE_AUCUNE); // 7 + + Afficher_curseur(); + do + { + if (Redessiner_controles) + { + Effacer_curseur(); + Block(Fenetre_Pos_X+(Menu_Facteur_X*32), + Fenetre_Pos_Y+(Menu_Facteur_Y*33), + Menu_Facteur_X*21*8,Menu_Facteur_Y*8,CM_Clair); + Print_dans_fenetre_limite(32,33,Nom_touche(PtrRaccourci[0]),21,CM_Noir,CM_Clair); + Block(Fenetre_Pos_X+(Menu_Facteur_X*32), + Fenetre_Pos_Y+(Menu_Facteur_Y*52), + Menu_Facteur_X*21*8,Menu_Facteur_Y*8,CM_Clair); + Print_dans_fenetre_limite(32,52,Nom_touche(PtrRaccourci[1]),21,CM_Noir,CM_Clair); + + UpdateRect(Fenetre_Pos_X,Fenetre_Pos_Y,302*Menu_Facteur_X,131*Menu_Facteur_Y); + + Afficher_curseur(); + Redessiner_controles=0; + } + + Bouton_clicke=Fenetre_Bouton_clicke(); + + switch (Bouton_clicke) + { + case -1: + case 0: + break; + case 4: // Change 0 + Redefinir_controle(&PtrRaccourci[0], 32, 33); + Redessiner_controles=1; + break; + case 6: // Change 1 + Redefinir_controle(&PtrRaccourci[1], 32, 52); + Redessiner_controles=1; + break; + case 5: // Remove 0 + PtrRaccourci[0]=0; + Redessiner_controles=1; + break; + case 7: // Remove 1 + PtrRaccourci[1]=0; + Redessiner_controles=1; + break; + case 3: // Defaults + PtrRaccourci[0]=ConfigTouche[IndiceConfig].Touche; + PtrRaccourci[1]=ConfigTouche[IndiceConfig].Touche2; + Redessiner_controles=1; + break; + case 1: // Cancel + PtrRaccourci[0]=Sauve_raccourci[0]; + PtrRaccourci[1]=Sauve_raccourci[1]; + case 2: // OK + default: + break; + } + } + while ((Bouton_clicke!=1) && (Bouton_clicke!=2) && (Touche!=SDLK_RETURN)); + Touche=0; + Fermer_fenetre(); + Afficher_curseur(); +} // -- Menu d'aide ----------------------------------------------------------- @@ -296,6 +442,8 @@ void Fenetre_aide(int Section, const char *Sous_section) Fenetre_Definir_bouton_normal( 9+6*8+4+8*8+4,154, 5*8,14,"Help",1,1,SDLK_h); // 5 Fenetre_Definir_bouton_normal(9+6*8+4+8*8+4+5*8+4,154, 8*8,14,"Credits",1,1,SDLK_c); // 6 + Fenetre_Definir_bouton_special(9,18,272,130); // 7 + Afficher_aide(); UpdateRect(Fenetre_Pos_X,Fenetre_Pos_Y,310*Menu_Facteur_X,175*Menu_Facteur_Y); @@ -312,6 +460,30 @@ void Fenetre_aide(int Section, const char *Sous_section) case 0: case 1: break; + case 7: // Zone de texte + { + int Ligne = ((Mouse_Y-Fenetre_Pos_Y)/Menu_Facteur_Y - 18)/8; + Attendre_fin_de_click(); + if (Ligne == ((Mouse_Y-Fenetre_Pos_Y)/Menu_Facteur_Y - 18)/8) + { + if (Position_d_aide_en_cours+Ligne2) diff --git a/clavier.c b/clavier.c index baff4986..e542a258 100644 --- a/clavier.c +++ b/clavier.c @@ -307,6 +307,21 @@ word Touche_pour_scancode(word scancode) return Scancode_to_Sym[scancode & 0xFF][0]; } +// Convertit des modificateurs de touches SDL en modificateurs GrafX2 +word Modificateurs_Touche(SDLMod Mod) +{ + word Modificateur=0; + + if (Mod & KMOD_CTRL ) + Modificateur|=MOD_CTRL; + if (Mod & KMOD_SHIFT ) + Modificateur|=MOD_SHIFT; + if (Mod & (KMOD_ALT|KMOD_MODE)) + Modificateur|=MOD_ALT; + + return Modificateur; +} + word Conversion_Touche(SDL_keysym Sym) { word Retour = 0; @@ -331,14 +346,9 @@ word Conversion_Touche(SDL_keysym Sym) // Normally I should test Sym.mod here, but on windows the implementation // is buggy: if you release a modifier key, the following keys (when they repeat) // still name the original modifiers. - Mod=SDL_GetModState(); + Mod=Modificateurs_Touche(SDL_GetModState()); // SDL_GetModState() seems to get the right up-to-date info. - if (Mod & (KMOD_LSHIFT | KMOD_RSHIFT)) - Retour |= MOD_SHIFT; - if (Mod & (KMOD_LCTRL | KMOD_RCTRL)) - Retour |= MOD_CTRL; - if (Mod & (KMOD_LALT | KMOD_RALT | KMOD_MODE)) - Retour |= MOD_ALT; + Retour |= Mod; return Retour; } @@ -431,12 +441,18 @@ const char * Nom_touche(word Touche) static char Buffer[41]; Buffer[0] = '\0'; + if (Touche == SDLK_UNKNOWN) + return "None"; + if (Touche & MOD_CTRL) strcat(Buffer, "Ctrl+"); if (Touche & MOD_ALT) strcat(Buffer, "Alt+"); if (Touche & MOD_SHIFT) strcat(Buffer, "Shift+"); + + Touche=Touche & ~(MOD_CTRL|MOD_ALT|MOD_SHIFT); + if (Touche>=TOUCHE_BUTTON && Touche<=TOUCHE_BUTTON+18) { #ifdef __gp2x__ @@ -467,7 +483,7 @@ const char * Nom_touche(word Touche) } strcat(Buffer,NomBouton); #else - sprintf(Buffer+strlen(Buffer), "[B%d]", Touche); + sprintf(Buffer+strlen(Buffer), "[B%d]", Touche-TOUCHE_BUTTON); #endif return Buffer; } diff --git a/clavier.h b/clavier.h index ee9de8e6..78a22afd 100644 --- a/clavier.h +++ b/clavier.h @@ -24,4 +24,5 @@ word Conversion_ANSI(SDL_keysym Sym); word Conversion_Touche(SDL_keysym Sym); word Touche_pour_scancode(word scancode); const char * Nom_touche(word Touche); +word Modificateurs_Touche(SDLMod Mod); diff --git a/global.h b/global.h index 79c2534e..0cce4ff7 100644 --- a/global.h +++ b/global.h @@ -680,6 +680,7 @@ GFX2_GLOBAL fonction_lecteur Lit_pixel_de_sauvegarde; GFX2_GLOBAL SDL_Surface * Ecran_SDL; GFX2_GLOBAL SDL_Joystick* joystick; +#define TOUCHE_AUCUNE 0 #define TOUCHE_MOUSEMIDDLE (SDLK_LAST+1) #define TOUCHE_MOUSEWHEELUP (SDLK_LAST+2) #define TOUCHE_MOUSEWHEELDOWN (SDLK_LAST+3) diff --git a/hotkeys.h b/hotkeys.h index c257635c..fe3f269e 100644 --- a/hotkeys.h +++ b/hotkeys.h @@ -24,953 +24,17 @@ /*** Types definitions and structs ***/ -typedef struct{ - uint16_t Numero; +typedef struct +{ + word Numero; char Libelle[36]; - char Explic1[77]; - char Explic2[77]; + char Explic1[37]; + char Explic2[37]; + char Explic3[37]; bool Suppr; // Raccourci facultatif - uint16_t Touche; - uint16_t Touche2; + word Touche; + word Touche2; } S_ConfigTouche; -S_ConfigTouche ConfigTouche[] = { - {0, - "Scroll up", - "Scrolls the picture up, both in magnify and normal mode.", - "This hotkey cannot be removed.", - false, - SDLK_UP, // HAUT - 0}, - {1, - "Scroll down", - "Scrolls the picture down, both in magnify and normal mode.", - "This hotkey cannot be removed.", - false, - SDLK_DOWN, // BAS - 0}, - {2, - "Scroll left", - "Scrolls the picture to the left, both in magnify and normal mode.", - "This hotkey cannot be removed.", - false, - SDLK_LEFT, // GAUCHE - 0}, - {3, - "Scroll right", - "Scrolls the picture to the right, both in magnify and normal mode.", - "This hotkey cannot be removed.", - false, - SDLK_RIGHT, // DROITE - 0}, - {4, - "Faster scroll up", - "Used to scroll upwards in the picture fast, either in magnify and normal", - "mode.", - true, - SDLK_UP|MOD_SHIFT, // Shift + Haut - 0}, - {5, - "Faster scroll down", - "Used to scroll downwards in the picture fast, either in magnify and normal", - "mode.", - true, - SDLK_DOWN|MOD_SHIFT, // Shift + Bas - 0}, - {6, - "Faster scroll left", - "Used to scroll to the left in the picture fast, either in magnify and normal", - "mode.", - true, - SDLK_LEFT|MOD_SHIFT, // Shift + Gauche - 0}, - {7, - "Faster scroll right", - "Used to scroll to the right in the picture fast, either in magnify and", - "normal mode.", - true, - SDLK_RIGHT|MOD_SHIFT, // Shift + Droite - 0}, - {8, - "Slower scroll up", - "Used to scroll upwards in the picture pixel by pixel, either in magnify and", - "normal mode.", - true, - SDLK_UP|MOD_ALT, // Alt + Haut - 0}, - {9, - "Slower scroll down", - "Used to scroll downwards in the picture pixel by pixel, either in magnify and", - "normal mode.", - true, - SDLK_DOWN|MOD_ALT, // Alt + Bas - 0}, - {10, - "Slower scroll left", - "Used to scroll to the left in the picture pixel by pixel, either in magnify", - "and normal mode.", - true, - SDLK_LEFT|MOD_ALT, // Alt + Gauche - 0}, - {11, - "Slower scroll right", - "Used to scroll to the right in the picture pixel by pixel, either in magnify", - "and normal mode.", - true, - SDLK_RIGHT|MOD_ALT, // Alt + Droite - 0}, - {12, - "Move mouse cursor 1 pixel up", - "Used to simulate a very small mouse deplacement upwards.", - "It""s very useful when you want a ultra-high precision.", - true, - SDLK_UP|MOD_CTRL, // Ctrl + Haut - 0}, - {13, - "Move mouse cursor 1 pixel down", - "Used to simulate a very small mouse deplacement downwards.", - "It""s very useful when you want a ultra-high precision.", - true, - SDLK_DOWN|MOD_CTRL, // Ctrl + Bas - 0}, - {14, - "Move mouse cursor 1 pixel left", - "Used to simulate a very small mouse deplacement to the left.", - "It""s very useful when you want a ultra-high precision.", - true, - SDLK_LEFT|MOD_CTRL, // Ctrl + Gauche - 0}, - {15, - "Move mouse cursor 1 pixel right", - "Used to simulate a very small mouse deplacement to the right.", - "It""s very useful when you want a ultra-high precision.", - true, - SDLK_RIGHT|MOD_CTRL, // Ctrl + Droite - 0}, - {16, - "Simulate left mouse click", - "Used to simulate a click with the left mouse button..", - "It""s very useful when you want a ultra-high precision.", - true, - SDLK_SPACE, // Space - 0}, - {17, - "Simulate right mouse click", - "Used to simulate a click with the right mouse button..", - "It""s very useful when you want a ultra-high precision.", - true, - SDLK_SPACE|MOD_SHIFT, // Shift + Space - 0}, - {18, - "Show/hide option menu", - "Switch the tool bar display on/off.", - "This hot-key cannot be removed.", - false, - SDLK_F10, // F10 - 0}, - {19, - "Show/hide cursor", - "Switch the cursor display on/off.", - "This only works on the \"small cross\" and \"hand\" cursors.", - true, - SDLK_F9, // F9 - 0}, - {20, - "Set paintbrush to 1 pixel", - "Useful when you want to use a \"single-pixel-brush\".", - "", - true, - SDLK_DELETE, // Del - 0}, - {21, - "Paintbrush choice", - "Opens a menu where you can choose a paintbrush out of 24 predefined ones.", - "", - true, - SDLK_F4, // F4 - 0}, - {22, - "Monochrome brush", - "Turn your current user-defined brush into a single colored one.", - "All non-transparent colors are set to current foreground color.", - true, - SDLK_F4|MOD_SHIFT, // Shift + F4 - 0}, - {23, - "Freehand drawing", - "Set the drawing mode to the classical freehand one.", - "", - true, - SDLK_d, // D - 0}, - {24, - "Switch freehand drawing mode", - "Switch between the 3 ways to use freehand drawing.", - "These modes are: continuous, discontinuous and point by point.", - true, - SDLK_d|MOD_SHIFT, // Shift + D - 0}, - {25, - "Continuous freehand drawing", - "Switch directly to continuous freehand drawing mode.", - "", - true, - SDLK_d|MOD_CTRL, // Ctrl + D - 0}, - {26, - "Line", - "Allows you to draw lines.", - "", - true, - SDLK_l, // L - 0}, - {27, - "Knotted lines", - "Allows you to draw linked lines.", - "This mode can also be called \"Polyline\".", - true, - SDLK_l|MOD_SHIFT, // Shift + L - 0}, - {28, - "Spray", - "Allows you to spray brushes randomly in the picture.", - "", - true, - SDLK_a, // A (Q en AZERTY) - 0}, - {29, - "Spray menu", - "Opens a menu in which you can configure the spray flow and size.", - "", - true, - SDLK_a|MOD_SHIFT, // Shift + A - 0}, - {30, - "Flood-fill", - "Allows you to fill an area of the picture made of pixels of the same color.", - "", - true, - SDLK_f, // F - 0}, - {124, - "Replace color", - "Allows you to replace all the pixels of the color pointed by the mouse with", - "the fore-color or the back-color.", - true, - SDLK_f|MOD_SHIFT, // Shift + F - 0}, - {31, - "Bezier""s curves", - "Allows you to draw Bezier""s curves.", - "", - true, - SDLK_i, // I - 0}, - {32, - "Bezier""s curve with 3 or 4 points", - "Allows you to choose whether you want to draw Bezier""s curves with 3 or 4", - "points.", - true, - SDLK_i|MOD_SHIFT, // Shift + I - 0}, - {33, - "Empty rectangle", - "Allows you to draw a rectangle using the brush.", - "", - true, - SDLK_r, // R - 0}, - {34, - "Filled rectangle", - "Allows you to draw a filled rectangle.", - "", - true, - SDLK_r|MOD_SHIFT, // Shift + R - 0}, - {35, - "Empty circle", - "Allows you to draw a circle using the brush.", - "", - true, - SDLK_c, // C - 0}, - {36, - "Empty ellipse", - "Allows you to draw an ellipse using the brush.", - "", - true, - SDLK_c|MOD_CTRL, // Ctrl + C - 0}, - {37, - "Filled circle", - "Allows you to draw a filled circle.", - "", - true, - SDLK_c|MOD_SHIFT, // Shift + C - 0}, - {38, - "Filled ellipse", - "Allows you to draw a filled ellipse.", - "", - true, - SDLK_c|MOD_SHIFT|MOD_CTRL, // Shift + Ctrl + C - 0}, - {39, - "Empty polygon", - "Allows you to draw a polygon using the brush.", - "", - true, - SDLK_n, // N - 0}, - {40, - "Empty \"polyform\"", - "Allows you to draw a freehand polygon using the brush.", - "", - true, - SDLK_n|MOD_CTRL, // Ctrl + N - 0}, - {41, - "Filled polygon", - "Allows you to draw a filled polygon.", - "", - true, - SDLK_n|MOD_SHIFT, // Shift + N - 0}, - {42, - "Filled \"polyform\"", - "Allows you to draw a filled freehand polygon.", - "", - true, - SDLK_n|MOD_SHIFT|MOD_CTRL, // Shift + Ctrl + N - 0}, - {43, - "Rectangle with gradation", - "Allows you to draw a rectangle with a color gradation.", - "", - true, - SDLK_r|MOD_ALT, // Alt + R - 0}, - {44, - "Gradation menu", - "Allows you to configure the way color gradations are calculated.", - "", - true, - SDLK_g|MOD_ALT, // Alt + G - 0}, - {45, - "Sphere with gradation", - "Allows you to draw a rectangle with a color gradation.", - "", - true, - SDLK_c|MOD_ALT, // Alt + C - 0}, - {46, - "Ellipse with gradation", - "Allows you to draw an ellipse filled with a color gradation.", - "", - true, - SDLK_c|MOD_SHIFT|MOD_ALT, // Shift + Alt + C - 0}, - {47, - "Adjust picture", - "Allows you to move the whole picture in order to re-center it.", - "Notice that what gets out from a side reappears on the other.", - true, - SDLK_KP5, // Kpad5 - 0}, - {48, - "Flip/shrink picture menu", - "Opens a menu which allows you to flip the picture horizontally/vertically or", - "to shrink it to half-scale horizontally and/or vertically.", - true, - SDLK_KP5|MOD_SHIFT, // Shift + Kpad5 - 0}, - {49, - "Drawing effects", - "Opens a menu where you can enable/disable and configure the drawing effects", - "listed below.", - true, - SDLK_e, // E - 0}, - {50, - "Shade mode", - "Allows you to shade or lighten some pixels of the picture belonging to a", - "color range, in addition of any drawing tool.", - true, - SDLK_F5, // F5 - 0}, - {51, - "Shade menu", - "Opens a menu where you can choose color ranges to use with the Shade mode.", - "This menu also contains parameters used both in Shade and Quick-shade modes.", - true, - SDLK_F5|MOD_SHIFT, // Shift + F5 - 0}, - {131, - "Quick-shade mode", - "Does the same thing as shade mode with a simpler method (faster to define", - "but a bit less powerful).", - true, - SDLK_F5|MOD_CTRL, // Ctrl + F5 - 0}, - {132, - "Quick-shade menu", - "Opens a menu where you can define the parameters of the quick-shade mode.", - "", - true, - SDLK_F5|MOD_SHIFT|MOD_CTRL, // Shift + Ctrl + F5 - 0}, - {52, - "Stencil mode", - "Allows you to mask colors that must not be affected when you are drawing.", - "", - true, - SDLK_F6, // F6 - 0}, - {53, - "Stencil menu", - "Opens a menu where you can choose colors masked by the Stencil mode.", - "", - true, - SDLK_F6|MOD_SHIFT, // Shift + F6 - 0}, - {54, - "Mask mode", - "Allows you to mask colors of the spare page that will keep you from ", - "drawing. This mode should be called \"True stencil\".", - true, - SDLK_F6|MOD_ALT, // Alt + F6 - 0}, - {55, - "Mask menu", - "Opens a menu where you can choose colors for the Mask mode.", - "", - true, - SDLK_F6|MOD_SHIFT|MOD_ALT, // Shift + Alt + F6 - 0}, - {56, - "Grid mode", - "Force the cursor to snap up grid points.", - "", - true, - SDLK_g, // G - 0}, - {57, - "Grid menu", - "Open a menu where you can configure the grid used by Grid mode.", - "", - true, - SDLK_g|MOD_SHIFT, // Shift + G - 0}, - {58, - "Sieve mode", - "Only draws pixels on certain positions matching with a sieve.", - "", - true, - SDLK_g|MOD_CTRL, // Ctrl + G - 0}, - {59, - "Sieve menu", - "Opens a menu where you can configure the sieve.", - "", - true, - SDLK_g|MOD_SHIFT|MOD_CTRL, // Shift + Ctrl + G - 0}, - {60, - "Invert sieve", - "Inverts the pattern defined in the Sieve menu.", - "", - true, - SDLK_g|MOD_CTRL|MOD_ALT, // Ctrl + Alt + G - 0}, - {61, - "Colorize mode", - "Allows you to colorize the pixels on which your brush is pasted.", - "This permits you to make transparency effects.", - true, - SDLK_F7, // F7 - 0}, - {62, - "Colorize menu", - "Opens a menu where you can give the opacity percentage for Colorize mode.", - "", - true, - SDLK_F7|MOD_SHIFT, // Shift + F7 - 0}, - {63, - "Smooth mode", - "Soften pixels on which your brush is pasted.", - "", - true, - SDLK_F8, // F8 - 0}, - {123, - "Smooth menu", - "Opens a menu where you can define the Smooth matrix.", - "", - true, - SDLK_F8|MOD_SHIFT, // Shift + F8 - 0}, - {64, - "Smear mode", - "Smears the pixels when you move your brush on the picture.", - "", - true, - SDLK_F8|MOD_ALT, // Alt + F8 - 0}, - {65, - "Tiling mode", - "Puts parts of the brush where you draw.", - "", - true, - SDLK_b|MOD_ALT, // Alt + B - 0}, - {66, - "Tiling menu", - "Opens a menu where you can configure the origin of the tiling.", - "", - true, - SDLK_b|MOD_SHIFT|MOD_ALT, // Shift + Alt + B - 0}, - {67, - "Classical brush grabbing", - "Allows you to pick a brush defined within a rectangle.", - "", - true, - SDLK_b, // B - 0}, - {68, - "\"Lasso\" brush grabbing", - "Allows you to pick a brush defined within a freehand polygon.", - "", - true, - SDLK_b|MOD_CTRL, // Ctrl + B - 0}, - {69, - "Get previous brush back", - "Restore the last user-defined brush.", - "", - true, - SDLK_b|MOD_SHIFT, // Shift + B - 0}, - {70, - "Horizontal brush flipping", - "Reverse brush horizontally.", - "", - true, - SDLK_x, // X - 0}, - {71, - "Vertical brush flipping", - "Reverse brush vertically.", - "", - true, - SDLK_y, // Y - 0}, - {72, - "90ø brush rotation", - "Rotate the user-defined brush by 90ø (counter-clockwise).", - "", - true, - SDLK_z, // Z (W en AZERTY) - 0}, - {73, - "180ø brush rotation", - "Rotate the user-defined brush by 180ø.", - "", - true, - SDLK_z|MOD_SHIFT, // Shift + Z - 0}, - {74, - "Strech brush", - "Allows you to resize the user-defined brush.", - "", - true, - SDLK_s, // S - 0}, - {75, - "Distort brush", - "Allows you to distort the user-defined brush.", - "", - true, - SDLK_s|MOD_SHIFT, // Shift + S - 0}, - {76, - "Outline brush", - "Outlines the user-defined brush with the fore color.", - "", - true, - SDLK_o, // O - 0}, - {77, - "Nibble brush", - "Deletes the borders of the user-defined brush.", - "This does the opposite of the Outline option.", - true, - SDLK_o|MOD_SHIFT, // Shift + O - 0}, - {78, - "Get colors from brush", - "Copy colors of the spare page that are used in the brush.", - "", - true, - SDLK_F11, // F11 - 0}, - {79, - "Recolorize brush", - "Recolorize pixels of the user-defined brush in order to get a brush which", - "looks like the one grabbed in the spare page.", - true, - SDLK_F12, // F12 - 0}, - {80, - "Rotate by any angle", - "Rotate the brush by an angle that you can define.", - "", - true, - SDLK_w, // W (Z en AZERTY) - 0}, - {81, - "Pipette", - "Allows you to copy the color of a pixel in the picture into the foreground", - "or background color.", - true, - SDLK_BACKQUOTE, // `~ (Touche sous le Esc - ² en AZERTY) - 0}, - {82, - "Swap foreground/background colors", - "Invert foreground and background colors.", - "", - true, - SDLK_BACKQUOTE|MOD_SHIFT, // Shift + `~ - 0}, - {83, - "Magnifier mode", - "Allows you to zoom into the picture.", - "", - true, - SDLK_m, // M (, ? sur AZERTY) - TOUCHE_MOUSEMIDDLE}, - {84, - "Zoom factor menu", - "Opens a menu where you can choose a magnifying factor.", - "", - true, - SDLK_m|MOD_SHIFT, // Shift + M - 0}, - {85, - "Zoom in", - "Increase magnifying factor.", - "", - true, - SDLK_KP_PLUS, // Grey + - TOUCHE_MOUSEWHEELUP}, - {86, - "Zoom out", - "Decrease magnifying factor.", - "", - true, - SDLK_KP_MINUS, // Grey - - TOUCHE_MOUSEWHEELDOWN}, - {87, - "Brush effects menu", - "Opens a menu which proposes different effects on the user-defined brush.", - "", - true, - SDLK_b|MOD_CTRL|MOD_ALT, // Ctrl + Alt + B - 0}, - {88, - "Text", - "Opens a menu which permits you to type in a character string and to choose a", - "font, and then creates a new user-defined brush fitting to your choices.", - true, - SDLK_t, // T - 0}, - {89, - "Screen resolution menu", - "Opens a menu where you can choose the dimensions of the screen in which you", - "want to draw among the numerous X and SVGA proposed modes.", - true, - SDLK_RETURN, // Enter - 0}, - {90, - "\"Safety\" resolution", - "Set resolution to 320x200. This can be useful if you choosed a resolution", - "that is not supported by your monitor and video card. Cannot be removed.", - false, - SDLK_RETURN|MOD_SHIFT, // Shift + Enter - 0}, - {91, - "Help and credits", - "Opens a window where you can get information about the program.", - "", - true, - SDLK_F1, // F1 - 0}, - {92, - "Statistics", - "Displays miscellaneous more or less useful information.", - "", - true, - SDLK_F1|MOD_SHIFT, // Shift + F1 - 0}, - {93, - "Jump to spare page", - "Swap current page and spare page.", - "", - true, - SDLK_TAB, // Tab - 0}, - {94, - "Copy current page to spare page", - "Copy current page to spare page.", - "", - true, - SDLK_TAB|MOD_SHIFT, // Shift + Tab - 0}, - {95, - "Save picture as...", - "Opens a file-selector that allows you to save your picture with a new", - "path-name.", - true, - SDLK_F2, // F2 - 0}, - {96, - "Save picture", - "Saves your picture with the last name you gave it.", - "", - true, - SDLK_F2|MOD_SHIFT, // Shift + F2 - 0}, - {97, - "Load picture", - "Opens a file-selector that allows you to load a new picture.", - "", - true, - SDLK_F3, // F3 - 0}, - {98, - "Re-load picture", - "Re-load the current picture.", - "This allows you to cancel modifications made since last saving.", - true, - SDLK_F3|MOD_SHIFT, // Shift + F3 - 0}, - {99, - "Save brush", - "Opens a file-selector that allows you to save your current user-defined", - "brush.", - true, - SDLK_F2|MOD_CTRL, // Ctrl + F2 - 0}, - {100, - "Load brush", - "Opens a file-selector that allows you to load a brush.", - "", - true, - SDLK_F3|MOD_CTRL, // Ctrl + F3 - 0}, - {101, - "Settings", - "Opens a menu which permits you to set the dimension of your picture, and to", - "modify some parameters of the program.", - true, - SDLK_F10|MOD_SHIFT, // Shift + F10 - 0}, - {102, - "Undo (Oops!)", - "Cancel the last action which modified the picture. This has no effect after", - "a jump to the spare page, loading a picture or modifying its size.", - true, - SDLK_u, // U - 0}, - {103, - "Redo", - "Redo the last undone action. This has no effect after a jump to the spare", - "page, loading a picture or modifying its size.", - true, - SDLK_u|MOD_SHIFT, // Shift + U - 0}, - {133, - "Kill", - "Kills the current page. It actually removes the current page from the list", - "of \"Undo\" pages.", - true, - SDLK_DELETE|MOD_SHIFT, // Shift + Suppr - 0}, - {104, - "Clear page", - "Clears the picture with the first color of the palette (usually black).", - "", - true, - SDLK_BACKSPACE, // BackSpace - 0}, - {105, - "Clear page with backcolor", - "Clears the picture with the backcolor.", - "", - true, - SDLK_BACKSPACE|MOD_SHIFT, // Shift + BackSpace - 0}, - {106, - "Quit program", - "Allows you to leave the program.", - "If modifications were not saved, confirmation is asked.", - false, - SDLK_q, // Q (A en AZERTY) - 0}, - {107, - "Palette menu", - "Opens a menu which allows you to modify the current palette.", - "", - true, - SDLK_p, // P - 0}, - {125, - "Secondary palette menu", - "Opens a menu which allows you to define color series and some tagged colors.", - "", - true, - SDLK_p|MOD_SHIFT, // Shift + P - 0}, - {130, - "Exclude colors menu", - "Opens a menu which allows you to define the colors you don""t want to use in", - "modes such as Smooth and Transparency, or when remapping a brush.", - true, - SDLK_p|MOD_CTRL, // Ctrl + P - 0}, - {108, - "Scroll palette to the left", - "Scroll palette in the tool bar to the left, column by column.", - "", - true, - SDLK_PAGEUP, // PgUp - 0}, - {109, - "Scroll palette to the right", - "Scroll palette in the tool bar to the right, column by column.", - "", - true, - SDLK_PAGEDOWN, // PgDn - 0}, - {110, - "Scroll palette to the left faster", - "Scroll palette in the tool bar to the left, 8 columns by 8 columns.", - "", - true, - SDLK_PAGEUP|MOD_SHIFT, // Shift + PgUp - 0}, - {111, - "Scroll palette to the right faster", - "Scroll palette in the tool bar to the right, 8 columns by 8 columns.", - "", - true, - SDLK_PAGEDOWN|MOD_SHIFT, // Shift + PgDn - 0}, - {112, - "Center brush attachment point", - "Set the attachement of the user-defined brush to its center.", - "", - true, - SDLK_KP5|MOD_CTRL, // Ctrl + 5 (pavé numérique) - 0}, - {113, - "Top-left brush attachment point", - "Set the attachement of the user-defined brush to its top-left corner.", - "", - true, - SDLK_HOME|MOD_CTRL, // Ctrl + 7 - 0}, - {114, - "Top-right brush attachment point", - "Set the attachement of the user-defined brush to its top-right corner.", - "", - true, - SDLK_PAGEUP|MOD_CTRL, // Ctrl + 9 - 0}, - {115, - "Bottom-left brush attachment point", - "Set the attachement of the user-defined brush to its bottom-left corner.", - "", - true, - SDLK_END|MOD_CTRL, // Ctrl + 1 - 0}, - {116, - "Bottom-right brush attachment point", - "Set the attachement of the user-defined brush to its bottom-right corner.", - "", - true, - SDLK_PAGEDOWN|MOD_CTRL, // Ctrl + 3 - 0}, - {117, - "Next foreground color", - "Set the foreground color to the next in the palette.", - "", - true, - SDLK_RIGHTBRACKET, // ] (0x en AZERTY) - 0}, - {118, - "Previous foreground color", - "Set the foreground color to the previous in the palette.", - "", - true, - SDLK_LEFTBRACKET, // [ (^ en AZERTY) - 0}, - {119, - "Next background color", - "Set the background color to the next in the palette.", - "", - true, - SDLK_RIGHTBRACKET|MOD_SHIFT, // Shift + ] - 0}, - {120, - "Previous background color", - "Set the background color to the previous in the palette.", - "", - true, - SDLK_LEFTBRACKET|MOD_SHIFT, // Shift + [ - 0}, - {126, - "Next user-defined forecolor", - "Set the foreground color to the next in the user-defined color series.", - "", - true, - SDLK_EQUALS, // "=+" - 0}, - {127, - "Previous user-defined forecolor", - "Set the foreground color to the previous in the user-defined color series.", - "", - true, - SDLK_MINUS, // "-_" (")ø" en AZERTY - 0}, - {128, - "Next user-defined backcolor", - "Set the background color to the next in the user-defined color series.", - "", - true, - SDLK_EQUALS|MOD_SHIFT, // Shift + "=+" - 0}, - {129, - "Previous user-defined backcolor", - "Set the background color to the previous in the user-defined color series.", - "", - true, - SDLK_MINUS|MOD_SHIFT, // Shift + "-_" (")ø" en AZERTY - 0}, - {121, - "Shrink paintbrush", - "Decrease the width of the paintbrush if it is special circle or square.", - "", - true, - SDLK_COMMA, // , < (;. en AZERTY) - 0}, - {122, - "Enlarge paintbrush", - "Increase the width of the paintbrush if it is special circle or square.", - "", - true, - SDLK_PERIOD, // .> (:/ en AZERTY) - 0}, -}; +extern S_ConfigTouche ConfigTouche[NB_TOUCHES]; +extern word Ordonnancement[NB_TOUCHES]; diff --git a/init.c b/init.c index f1af2bc3..db581082 100644 --- a/init.c +++ b/init.c @@ -1766,147 +1766,6 @@ void Definition_des_modes_video(void) //--------------------------------------------------------------------------- - - - -word Ordonnancement[NB_TOUCHES]= -{ - SPECIAL_SCROLL_UP, // Scroll up - SPECIAL_SCROLL_DOWN, // Scroll down - SPECIAL_SCROLL_LEFT, // Scroll left - SPECIAL_SCROLL_RIGHT, // Scroll right - SPECIAL_SCROLL_UP_FAST, // Scroll up faster - SPECIAL_SCROLL_DOWN_FAST, // Scroll down faster - SPECIAL_SCROLL_LEFT_FAST, // Scroll left faster - SPECIAL_SCROLL_RIGHT_FAST, // Scroll right faster - SPECIAL_SCROLL_UP_SLOW, // Scroll up slower - SPECIAL_SCROLL_DOWN_SLOW, // Scroll down slower - SPECIAL_SCROLL_LEFT_SLOW, // Scroll left slower - SPECIAL_SCROLL_RIGHT_SLOW, // Scroll right slower - SPECIAL_MOUSE_UP, // Emulate mouse up - SPECIAL_MOUSE_DOWN, // Emulate mouse down - SPECIAL_MOUSE_LEFT, // Emulate mouse left - SPECIAL_MOUSE_RIGHT, // Emulate mouse right - SPECIAL_CLICK_LEFT, // Emulate mouse click left - SPECIAL_CLICK_RIGHT, // Emulate mouse click right - 0x100+BOUTON_CACHER, // Show / Hide menu - SPECIAL_SHOW_HIDE_CURSOR, // Show / Hide cursor - SPECIAL_PINCEAU_POINT, // Paintbrush = "." - 0x100+BOUTON_PINCEAUX, // Paintbrush choice - 0x200+BOUTON_PINCEAUX, // Monochrome brush - 0x100+BOUTON_DESSIN, // Freehand drawing - 0x200+BOUTON_DESSIN, // Switch freehand drawing mode - SPECIAL_DESSIN_CONTINU, // Continuous freehand drawing - 0x100+BOUTON_LIGNES, // Line - 0x200+BOUTON_LIGNES, // Knotted lines - 0x100+BOUTON_SPRAY, // Spray - 0x200+BOUTON_SPRAY, // Spray menu - 0x100+BOUTON_FLOODFILL, // Floodfill - 0x200+BOUTON_FLOODFILL, // Replace color - 0x100+BOUTON_COURBES, // Bézier's curves - 0x200+BOUTON_COURBES, // Bézier's curve with 3 or 4 points - 0x100+BOUTON_RECTANGLES, // Empty rectangle - 0x100+BOUTON_FILLRECT, // Filled rectangle - 0x100+BOUTON_CERCLES, // Empty circle - 0x200+BOUTON_CERCLES, // Empty ellipse - 0x100+BOUTON_FILLCERC, // Filled circle - 0x200+BOUTON_FILLCERC, // Filled ellipse - 0x100+BOUTON_POLYGONES, // Empty polygon - 0x200+BOUTON_POLYGONES, // Empty polyform - 0x100+BOUTON_POLYFILL, // Polyfill - 0x200+BOUTON_POLYFILL, // Filled polyform - 0x100+BOUTON_GRADRECT, // Gradient rectangle - 0x100+BOUTON_GRADMENU, // Gradation menu - 0x100+BOUTON_SPHERES, // Spheres - 0x200+BOUTON_SPHERES, // Gradient ellipses - 0x100+BOUTON_AJUSTER, // Adjust picture - 0x200+BOUTON_AJUSTER, // Flip picture menu - 0x100+BOUTON_EFFETS, // Menu des effets - SPECIAL_SHADE_MODE, // Shade mode - SPECIAL_SHADE_MENU, // Shade menu - SPECIAL_QUICK_SHADE_MODE, // Quick-shade mode - SPECIAL_QUICK_SHADE_MENU, // Quick-shade menu - SPECIAL_STENCIL_MODE, // Stencil mode - SPECIAL_STENCIL_MENU, // Stencil menu - SPECIAL_MASK_MODE, // Mask mode - SPECIAL_MASK_MENU, // Mask menu - SPECIAL_GRID_MODE, // Grid mode - SPECIAL_GRID_MENU, // Grid menu - SPECIAL_SIEVE_MODE, // Sieve mode - SPECIAL_SIEVE_MENU, // Sieve menu - SPECIAL_INVERT_SIEVE, // Inverser la trame du mode Sieve - SPECIAL_COLORIZE_MODE, // Colorize mode - SPECIAL_COLORIZE_MENU, // Colorize menu - SPECIAL_SMOOTH_MODE, // Smooth mode - SPECIAL_SMOOTH_MENU, // Smooth menu - SPECIAL_SMEAR_MODE, // Smear mode - SPECIAL_TILING_MODE, // Tiling mode - SPECIAL_TILING_MENU, // Tiling menu - 0x100+BOUTON_BROSSE, // Pick brush - 0x100+BOUTON_POLYBROSSE, // Pick polyform brush - 0x200+BOUTON_BROSSE, // Restore brush - SPECIAL_FLIP_X, // Flip X - SPECIAL_FLIP_Y, // Flip Y - SPECIAL_ROTATE_90, // 90° brush rotation - SPECIAL_ROTATE_180, // 180° brush rotation - SPECIAL_STRETCH, // Stretch brush - SPECIAL_DISTORT, // Distort brush - SPECIAL_OUTLINE, // Outline brush - SPECIAL_NIBBLE, // Nibble brush - SPECIAL_GET_BRUSH_COLORS, // Get colors from brush - SPECIAL_RECOLORIZE_BRUSH, // Recolorize brush - SPECIAL_ROTATE_ANY_ANGLE, // Rotate brush by any angle - 0x100+BOUTON_PIPETTE, // Pipette - 0x200+BOUTON_PIPETTE, // Swap fore/back color - 0x100+BOUTON_LOUPE, // Magnifier mode - 0x200+BOUTON_LOUPE, // Zoom factor menu - SPECIAL_ZOOM_IN, // Zoom in - SPECIAL_ZOOM_OUT, // Zoom out - 0x100+BOUTON_EFFETS_BROSSE, // Brush effects menu - 0x100+BOUTON_TEXTE, // Text - 0x100+BOUTON_RESOL, // Resolution menu - 0x200+BOUTON_RESOL, // Safety resolution - 0x100+BOUTON_AIDE, // Help & credits - 0x200+BOUTON_AIDE, // Statistics - 0x100+BOUTON_PAGE, // Go to spare page - 0x200+BOUTON_PAGE, // Copy to spare page - 0x100+BOUTON_SAUVER, // Save as - 0x200+BOUTON_SAUVER, // Save - 0x100+BOUTON_CHARGER, // Load - 0x200+BOUTON_CHARGER, // Re-load - SPECIAL_SAVE_BRUSH, // Save brush - SPECIAL_LOAD_BRUSH, // Load brush - 0x100+BOUTON_PARAMETRES, // Settings - 0x100+BOUTON_UNDO, // Undo - 0x200+BOUTON_UNDO, // Redo - 0x100+BOUTON_KILL, // Kill - 0x100+BOUTON_CLEAR, // Clear - 0x200+BOUTON_CLEAR, // Clear with backcolor - 0x100+BOUTON_QUIT, // Quit - 0x100+BOUTON_PALETTE, // Palette menu - 0x200+BOUTON_PALETTE, // Palette menu secondaire - SPECIAL_EXCLUDE_COLORS_MENU, // Exclude colors menu - 0x100+BOUTON_PAL_LEFT, // Scroll palette left - 0x100+BOUTON_PAL_RIGHT, // Scroll palette right - 0x200+BOUTON_PAL_LEFT, // Scroll palette left faster - 0x200+BOUTON_PAL_RIGHT, // Scroll palette right faster - SPECIAL_CENTER_ATTACHMENT, // Center brush attachement - SPECIAL_TOP_LEFT_ATTACHMENT, // Top-left brush attachement - SPECIAL_TOP_RIGHT_ATTACHMENT, // Top-right brush attachement - SPECIAL_BOTTOM_LEFT_ATTACHMENT, // Bottom-left brush attachement - SPECIAL_BOTTOM_RIGHT_ATTACHMENT, // Bottom right brush attachement - SPECIAL_NEXT_FORECOLOR, // Next foreground color - SPECIAL_PREVIOUS_FORECOLOR, // Previous foreground color - SPECIAL_NEXT_BACKCOLOR, // Next background color - SPECIAL_PREVIOUS_BACKCOLOR, // Previous background color - SPECIAL_NEXT_USER_FORECOLOR, // Next user-defined foreground color - SPECIAL_PREVIOUS_USER_FORECOLOR, // Previous user-defined foreground color - SPECIAL_NEXT_USER_BACKCOLOR, // Next user-defined background color - SPECIAL_PREVIOUS_USER_BACKCOLOR, // Previous user-defined background color - SPECIAL_RETRECIR_PINCEAU, // Rétrécir le pinceau - SPECIAL_GROSSIR_PINCEAU // Grossir le pinceau -}; - int Charger_CFG(int Tout_charger) { FILE* Handle; diff --git a/input.c b/input.c index fcd9aeb5..dd645686 100644 --- a/input.c +++ b/input.c @@ -197,16 +197,16 @@ int Handle_Mouse_Click(SDL_MouseButtonEvent event) break; case SDL_BUTTON_MIDDLE: - Touche = TOUCHE_MOUSEMIDDLE; + Touche = TOUCHE_MOUSEMIDDLE|Modificateurs_Touche(SDL_GetModState()); // TODO: systeme de répétition return 0; case SDL_BUTTON_WHEELUP: - Touche = TOUCHE_MOUSEWHEELUP; + Touche = TOUCHE_MOUSEWHEELUP|Modificateurs_Touche(SDL_GetModState()); return 0; case SDL_BUTTON_WHEELDOWN: - Touche = TOUCHE_MOUSEWHEELDOWN; + Touche = TOUCHE_MOUSEWHEELDOWN|Modificateurs_Touche(SDL_GetModState()); return 0; default: return 0; @@ -433,7 +433,7 @@ int Handle_Joystick_Press(SDL_JoyButtonEvent event) default: } #endif - Touche = TOUCHE_BUTTON+event.button; + Touche = (TOUCHE_BUTTON+event.button)|Modificateurs_Touche(SDL_GetModState()); // TODO: systeme de répétition return Move_cursor_with_constraints(); diff --git a/tables_aide.h b/tables_aide.h index fb8be5c7..89d3e917 100644 --- a/tables_aide.h +++ b/tables_aide.h @@ -81,16 +81,17 @@ static const T_TABLEAIDE TableAideLicense[] = }; static const T_TABLEAIDE TableAideHelp[] = { - AIDE_TITRE("HELP") + AIDE_TITRE(" HELP") AIDE_TEXTE("") AIDE_TEXTE(" Contextual help is available by pressing") AIDE_LIEN (" the %s key",0x100+BOUTON_AIDE) AIDE_TEXTE(" You can do it while hovering a menu icon,") AIDE_TEXTE(" or while a window is open.") + AIDE_TEXTE(" When a keyboard shortcut is displayed it's") + AIDE_TEXTE(" your current configuration and you can") + AIDE_TEXTE(" change it by clicking it.") AIDE_TEXTE("") - AIDE_BOLD (" LIST OF KEYBOARD SHORTCUTS") - AIDE_TEXTE("") - AIDE_TEXTE("This is your current configuration.") + AIDE_TITRE(" KEYBOARD SHORTCUTS") AIDE_TEXTE("") AIDE_TEXTE("Scroll visible area") AIDE_LIEN (" up: %s", SPECIAL_SCROLL_UP) diff --git a/windows.c b/windows.c index fb2262aa..472d40b9 100644 --- a/windows.c +++ b/windows.c @@ -379,7 +379,7 @@ void Print_char_transparent_dans_fenetre(short Pos_X,short Pos_Y,unsigned char C // -- Afficher une chaîne dans une fenêtre, avec taille maxi -- -void Print_dans_fenetre_limite(short X,short Y,char * Chaine,byte Taille,byte Couleur_texte,byte Couleur_fond) +void Print_dans_fenetre_limite(short X,short Y,const char * Chaine,byte Taille,byte Couleur_texte,byte Couleur_fond) { char Chaine_affichee[256]; strncpy(Chaine_affichee, Chaine, Taille); diff --git a/windows.h b/windows.h index 85a46e85..2e18be87 100644 --- a/windows.h +++ b/windows.h @@ -42,7 +42,7 @@ void Recadrer_palette(void); void Print_general(short X,short Y,char * Chaine,byte Couleur_texte,byte Couleur_fond); void Print_dans_fenetre(short X,short Y,char * Chaine,byte Couleur_texte,byte Couleur_fond); -void Print_dans_fenetre_limite(short X,short Y,char * Chaine,byte Taille,byte Couleur_texte,byte Couleur_fond); +void Print_dans_fenetre_limite(short X,short Y,const char * Chaine,byte Taille,byte Couleur_texte,byte Couleur_fond); void Print_char_dans_fenetre(short Pos_X,short Pos_Y,unsigned char Caractere,byte Couleur_texte,byte Couleur_fond); void Print_char_transparent_dans_fenetre(short Pos_X,short Pos_Y,unsigned char Caractere,byte Couleur); void Print_dans_menu(char * Chaine, short Position);