<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><category>pcsoft.fr.windev</category><copyright>Copyright 2026, PC SOFT</copyright><lastBuildDate>6 Jul 2020 11:40:34 Z</lastBuildDate><pubDate>6 Jul 2020 10:56:11 Z</pubDate><description>Bonjour,&#13;
&#13;
Ci dessous un petit code pour afficher la liste des raccourcis clavier d'une fenêtre.&#13;
&#13;
Merci à ceux qui ont répondu au post https://forum.pcsoft.fr/fr-FR/pcsoft.fr.windev/240929-raccourcis-clavier/read.awp&#13;
&#13;
Soit : &#13;
- constantesTouches un tableau associatif de chaines reprenant les constantes de KeyConst.wl &#13;
ex. &#13;
[code:wl]&#13;
constantesTouches[ 0x0D ] = "Entrée" // "VK_RETURN"&#13;
[/code]&#13;
- gproc_traduire_toucheRaccourci qui traduit le numéro de la propriété ..ToucheRaccourci en chaine&#13;
- gproc_afficher_touchesRaccourcis qui renvoie une info listant tous les raccourcis&#13;
&#13;
[code:wl]&#13;
PROCÉDURE gproc_traduire_toucheRaccourci( _toucheRaccourci est un entier, _libelle est une chaîne = "" )&#13;
&#13;
i, iMax est un entier&#13;
toucheRaccourci, valeurSansPoidsFaible est un entier &#13;
libelle, toucheControle, toucheCaractere, toucheConstante est une chaîne&#13;
combinaison est un tableau de 0 chaîne&#13;
avecEtCommercial est un booléen&#13;
	&#13;
toucheRaccourci = _toucheRaccourci&#13;
libelle = _libelle&#13;
&#13;
// Après '&amp;' du libellé&#13;
SI toucheRaccourci = 65535 _ET_ libelle &lt;&gt; "" ALORS&#13;
	&#13;
	iMax = Taille( libelle )&#13;
	POUR i = 1 À iMax&#13;
		&#13;
		SI libelle[ i ] = "&amp;" ALORS &#13;
			avecEtCommercial = PAS avecEtCommercial&#13;
		SINON SI avecEtCommercial ALORS&#13;
			TableauAjoute( combinaison, "Alt + " + libelle[ i ] )&#13;
			SORTIR&#13;
		FIN // SI libelle[ i ] = "&amp;" ALORS &#13;
		&#13;
	FIN // POUR i = 1 À iMax&#13;
	&#13;
SINON	&#13;
	&#13;
	valeurSansPoidsFaible = Val( toucheRaccourci - PoidsFaible( toucheRaccourci ) )&#13;
	&#13;
	SELON valeurSansPoidsFaible&#13;
		CAS trAlt : toucheControle = "Alt"&#13;
		CAS trControl : toucheControle = "Ctrl"&#13;
		CAS trShift : toucheControle = "Maj"&#13;
		AUTRE CAS : toucheControle = ""&#13;
	FIN // SELON valeurSansPoidsFaible&#13;
	&#13;
	SI toucheControle &lt;&gt; "" ALORS TableauAjoute( combinaison, toucheControle )&#13;
	&#13;
	SI PoidsFaible( toucheRaccourci ) &gt;= 0 ET PoidsFaible( toucheRaccourci ) &lt;= 255 ALORS &#13;
		&#13;
		toucheConstante = COL_Outils.constantesTouches[ PoidsFaible( toucheRaccourci ) ]&#13;
		SI toucheConstante &lt;&gt; "" ALORS&#13;
			&#13;
			TableauAjoute( combinaison, toucheConstante )&#13;
				&#13;
		SINON&#13;
		&#13;
		toucheCaractere = Caract( PoidsFaible( toucheRaccourci ) )&#13;
		SI toucheCaractere &lt;&gt; "" ALORS&#13;
			TableauAjoute( combinaison, toucheCaractere )&#13;
			FIN // SI toucheCaractere &lt;&gt; "" ALORS&#13;
			&#13;
		FIN // SI toucheConstante &lt;&gt; "" ALORS&#13;
		&#13;
	FIN // SI PoidsFaible( toucheRaccourci ) &gt;= 0 ET PoidsFaible( toucheRaccourci ) &lt;= 255 ALORS &#13;
	&#13;
FIN // SI toucheRaccourci = 65535 ALORS&#13;
		&#13;
RENVOYER TableauVersChaîne( combinaison, " + " )&#13;
[/code]&#13;
[code:wl]&#13;
PROCÉDURE gproc_afficher_touchesRaccourcis( _fenetreInterne est un Champ )&#13;
&#13;
raccourcis est un tableau de chaîne&#13;
&#13;
iproc_enumereChamp( _fenetreInterne )&#13;
&#13;
SI TableauOccurrence( raccourcis ) &gt; 0 ALORS&#13;
	TitreSuivant( "Raccourcis clavier" )&#13;
	Info( TableauVersChaîne( raccourcis, CR ) )&#13;
FIN // SI TableauOccurrence( raccourcis ) &gt; 0 ALORS&#13;
&#13;
PROCÉDURE INTERNE iproc_enumereChamp( LOCAL _parent est un Champ )&#13;
	&#13;
	i est un entier&#13;
	champ, libelle, raccourci est une chaîne&#13;
	parents est un tableau de Champ&#13;
	c est un Champ&#13;
	&#13;
	// Boucle sur les champs&#13;
	i = 1&#13;
	champ = EnumèreChamp( _parent, i )&#13;
	TANTQUE champ &lt;&gt; "" &#13;
		&#13;
		c &lt;- EnumèreChamp( _parent, i )&#13;
		&#13;
		SI c..Type DANS ( typDisposition, typFen, typGrp, typFenêtreInterne, typModèleDeChamp, typOnglet, typRegroupementRuban, typRuban, typSuperChamp, typTiroir, typVoletOnglet, typZoneMultiligne, typZoneRépétée ) ALORS&#13;
			&#13;
			TableauAjoute( parents, c )&#13;
			&#13;
		SINON&#13;
			&#13;
			SI c..ToucheRaccourci &lt;&gt; 0 ALORS&#13;
				&#13;
				raccourci = gproc_traduire_toucheRaccourci( c..ToucheRaccourci, c..Libellé )&#13;
				SI raccourci &lt;&gt; "" ALORS &#13;
					&#13;
					SELON c..Type&#13;
						&#13;
						CAS typBouton : libelle = "Bouton"&#13;
						CAS typComboAVS, typComboSNS, typListe, typListeImage : libelle = "Liste" 	&#13;
						CAS typInterr, typInterrupteurABascule : libelle = "Interrupteur"&#13;
						CAS typSélect : libelle = "Sélecteur"&#13;
						AUTRE CAS : libelle = "Champ"							&#13;
							&#13;
					FIN // SELON c..Type&#13;
					&#13;
					SI c..Libellé &lt;&gt; "" ALORS&#13;
						libelle += [ " " ] + c..Libellé&#13;
					SINON	&#13;
						libelle += [ " " ] + champ&#13;
					FIN // SI c..Libellé &lt;&gt; "" ALORS&#13;
					&#13;
					TableauAjoute( raccourcis, libelle + " : " + raccourci )&#13;
					&#13;
				FIN // SI raccourci &lt;&gt; "" ALORS &#13;
				&#13;
			FIN // SI champs[ champ ]..ToucheRaccourci &lt;&gt; 0 ALORS&#13;
			&#13;
		FIN // SI champs[ champ ]..Type DANS ( typDisposition, typFen, typGrp, typFenêtreInterne, typModèleDeChamp, typOnglet, typRegroupementRuban, typRuban, typSuperChamp, typTiroir, typVoletOnglet, typZoneMultiligne, typZoneRépétée ) ALORS&#13;
		&#13;
		i++&#13;
		champ = EnumèreChamp( _parent, i )&#13;
	FIN // TANTQUE champ &lt;&gt; ""&#13;
	&#13;
	POUR TOUT parent DE parents&#13;
		iproc_enumereChamp( parent )&#13;
	FIN // POUR TOUT parent de parents&#13;
		&#13;
FIN // PROCÉDURE INTERNE iproc_enumereChamp( LOCAL _parent est une chaîne )&#13;
[/code]&#13;
&#13;
Et le résultat : &#13;
https://hostimage.windev.io/images/capture1_29a616cd1308bf99fc6453127b862b42.png&#13;
&#13;
https://hostimage.windev.io/images/capture2_df5785c9e5a569b6cc52fbb25804918b.png</description><ttl>30</ttl><generator>WEBDEV</generator><language>fr_FR</language><link>https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/240956-raccourcis-clavier/read.awp</link><title>Raccourcis clavier</title><managingEditor>moderateur@pcsoft.fr (El moderador)</managingEditor><webMaster>webmaster@pcsoft.fr (El webmaster)</webMaster><item><author>Samir BOUCHETIBAT</author><category>pcsoft.fr.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/240956-raccourcis-clavier-240957/read.awp</comments><pubDate>6 Jul 2020 11:40:34 Z</pubDate><description>Bonjour,&#13;
Merci pour le partage.&#13;
Toujours appréciable d'avoir un retour sur l'usage fait des contributions.&#13;
&#13;
Bon dev !</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/240956-raccourcis-clavier-240957/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/240956-raccourcis-clavier-240957/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/240956-raccourcis-clavier/read.awp">Raccourcis clavier</source><title>Re: Raccourcis clavier</title></item></channel></rss>
