Beginning of setting to disable multi-shortcuts: settable in options, saved and reloaded, no effect so far.

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1768 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Yves Rizoud 2011-04-04 19:34:15 +00:00
parent 65b3c4290a
commit 1d24885ddc
5 changed files with 20 additions and 1 deletions

View File

@ -380,4 +380,11 @@
; ;
Scripts_directory = Scripts_directory =
; When this setting is disabled, and you create a shortcut with a key that
; is already associated to another shortcut, Grafx2 will unset the latter.
; If you enable this mode, Grafx2 will not make such check, so you can design
; shortcuts that trigger several actions at once.
;
Allow_multi_shortcuts = no; (Default no)
; end of configuration ; end of configuration

View File

@ -942,7 +942,7 @@ void Button_Settings(void)
{"Safety colors:",1,&(selected_config.Safety_colors),0,1,0,Lookup_YesNo}, {"Safety colors:",1,&(selected_config.Safety_colors),0,1,0,Lookup_YesNo},
{"Grid XOR color:",1,&(selected_config.Grid_XOR_color),0,255,3,NULL}, {"Grid XOR color:",1,&(selected_config.Grid_XOR_color),0,255,3,NULL},
{"Sync views:",1,&(selected_config.Sync_views),0,1,0,Lookup_YesNo}, {"Sync views:",1,&(selected_config.Sync_views),0,1,0,Lookup_YesNo},
{"",0,NULL,0,0,0,NULL}, {"Multi shortcuts",1,&(selected_config.Allow_multi_shortcuts),0,1,0,Lookup_YesNo},
{"",0,NULL,0,0,0,NULL}, {"",0,NULL,0,0,0,NULL},
{" --- Input ---",0,NULL,0,0,0,NULL}, {" --- Input ---",0,NULL,0,0,0,NULL},

View File

@ -948,6 +948,13 @@ int Load_INI(T_Config * conf)
Append_path(conf->Scripts_directory, "scripts", NULL); Append_path(conf->Scripts_directory, "scripts", NULL);
} }
conf->Allow_multi_shortcuts=0;
// Optional, allow or disallow multiple shortcuts on same key (>=2.3)
if (!Load_INI_get_values (file,buffer,"Allow_multi_shortcuts",1,values))
{
conf->Allow_multi_shortcuts=(values[0]!=0);
}
// Insert new values here // Insert new values here
fclose(file); fclose(file);

View File

@ -702,6 +702,10 @@ int Save_INI(T_Config * conf)
if ((return_code=Save_INI_set_strings (old_file,new_file,buffer,"Scripts_directory",conf->Scripts_directory))) if ((return_code=Save_INI_set_strings (old_file,new_file,buffer,"Scripts_directory",conf->Scripts_directory)))
goto Erreur_Retour; goto Erreur_Retour;
values[0]=(conf->Allow_multi_shortcuts);
if ((return_code=Save_INI_set_values (old_file,new_file,buffer,"Allow_multi_shortcuts",1,values,1)))
goto Erreur_Retour;
// Insert new values here // Insert new values here
Save_INI_flush(old_file,new_file,buffer); Save_INI_flush(old_file,new_file,buffer);

View File

@ -369,6 +369,7 @@ typedef struct
byte Stylus_mode; ///< Boolean, true to tweak some tools (eg:Curve) for single-button stylus. byte Stylus_mode; ///< Boolean, true to tweak some tools (eg:Curve) for single-button stylus.
word Swap_buttons; ///< Sets which key swaps mouse buttons : 0=none, or MOD_CTRL, or MOD_ALT. word Swap_buttons; ///< Sets which key swaps mouse buttons : 0=none, or MOD_CTRL, or MOD_ALT.
char Scripts_directory[MAX_PATH_CHARACTERS];///< Full pathname of directory for Lua scripts char Scripts_directory[MAX_PATH_CHARACTERS];///< Full pathname of directory for Lua scripts
byte Allow_multi_shortcuts; ///< Boolean, true if the same key combination can trigger multiple shortcuts.
} T_Config; } T_Config;
// Structures utilisées pour les descriptions de pages et de liste de pages. // Structures utilisées pour les descriptions de pages et de liste de pages.