PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2025 → Intercepter la touche SHIFT
Intercepter la touche SHIFT
Iniciado por contact, 01,nov. 2018 17:19 - 2 respuestas
Miembro registrado
3 mensajes
Publicado el 01,noviembre 2018 - 17:19
Bonjour tout le monde,

J'ai un petit soucis, je m'explique.

je doit déplacer une image dans une autre image pour le déplacement aux touches du clavier (flèches) pas de problème, j'applique un pas de 1 pix mais voila je désire que si l'utilisateur appuy sur la touche shift que le pas change a 10, mais si on laisse le doit appuyer cela ne marche pas.


Voici le code que j'ai pour le moment (j'ai compensé avec une variable, mais c'est pas élégant)

Procedure Deplacement()


SI TableOccurrence(TABLE_Calques)=0 ALORS RENVOYER Faux


SI _EVE.wParam = VK_SHIFT ALORS
SI gnPasAvancement=1 ALORS
gnPasAvancement=10
SINON
gnPasAvancement=1
FIN
FIN


SELON _EVE.wParam
CAS VK_RIGHT
nomimg est une chaîne
nomimg = TABLE_Calques.COL_NomImage
{nomimg,indChamp}..X+=gnPasAvancement
CAS VK_LEFT
nomimg est une chaîne
nomimg = TABLE_Calques.COL_NomImage.
{nomimg,indChamp}..X-=gnPasAvancement
CAS VK_DOWN
nomimg est une chaîne
nomimg = TABLE_Calques.COL_NomImage
{nomimg,indChamp}..Y+=gnPasAvancement
CAS VK_UP
nomimg est une chaîne
nomimg = TABLE_Calques.COL_NomImage
{nomimg,indChamp}..Y-=gnPasAvancement
AUTRE CAS

FIN


Si quelqu'un as une idée elle est la bienvenue.

Cordialement
Miembro registrado
356 mensajes
Publicado el 02,noviembre 2018 - 16:13
Bonjour,

Perso j'aurai plutôt fait
SI TableOccurrence(TABLE_Calques)=0 ALORS RENVOYER Faux

SI ToucheEnfoncée(teShift) ALORS gnPasAvancement=10 SINON gnPasAvancement=1

SELON _EVE.wParam
...
FIN


--
Francis MOREL
http://www.SoftProtect.fr
Miembro registrado
3 mensajes
Publicado el 06,noviembre 2018 - 14:27
Merci, je vais tester

Cordialement