Glovepie + Ppjoy + Cougar

Salle dedieé aux péripheriques : Joystick, palloniers, Track-Ir
Avatar de l’utilisateur

Topic author
hellfrog
Messages : 5117
Inscription : 22 août 2008

Glovepie + Ppjoy + Cougar

#1

Message par hellfrog »

keywords : JOYSTICK GLOVEPIE PPJOY HOTAS COUGAR INSTALL

L'objet de cette discussion est de présenter l'installation et les réglages des 3 pour qu'ils marchent ensembles.


En guise d'intro cf http://www.checksix-forums.com/showthre ... post881077 (en salle helico / BlackShark / support technique)

en attendant que je re rédige qqchose de plus synthétique, précis, complet , en français.
[SIGPIC]http://www.kirikoo.net/images/8WoodMAn- ... 212448.png[/img][/SIGPIC] (\_/) (_'.') ..i72600k@4.5GHz + AsusSabertoothZ77 + 16Go GSkill10700 + AC Noctua + Raptor + Win7x64Ult + WH MFDs SaitekThr 1920x1080x3 dt 1 tactile 6950 2G
(")_(")
[/align]
Avatar de l’utilisateur

Topic author
hellfrog
Messages : 5117
Inscription : 22 août 2008

INSTALLATION DE SPEECH pour glovepie

#2

Message par hellfrog »

Pour profiter de la synthèse vocale et de la reconnaissance vocale par Glovepie il faut : SAPI 5.1 ou supérieur

Image

Image

Image

pour la reconnaissance vocale:

[INDENT] Soit il faut la version de SAPI incluse dans le logiciel Microsoft Recogniser.

Soit Vista devait inclure Recogniser version 7.0, mais pas disponible à la sortie de Vista : donc version 6.1 sauf mise à jour.

Soit dans Microsoft Office 2003 : il y a Recogniser 6.1

Soit dans Microsoft Office XP (2002) : il y a la version 5.

Soit il faut une version Professionel ou Server de Windows 2000 et ajouter la version 6.1 incluse dans le Add-on Internet Explorer Speech Add-In (65Mb) :
http://www.ics.forth.gr/uachess/down..._add-in_v1.zip et
http://www.voicewebsolutions.net/com...AddInSetup.exe

Pour les utilisateurs de XP : SAPI 5.1 (50Mb):
[la version 6.1 ne marche pas sous XP !]
http://www.chant.net/downloads/sapi51.exe
ou le Software Development Kit SAPI 5.1 SDK (68Mb):
http://download.microsoft.com/downlo...peechsdk51.exe
[/INDENT]
pour la synthèse vocale seule:

[INDENT]Soit incluse dans Office XP (2002) ou supérieur

Soit incluse dans Windows XP

Soit incluse dans Internet Explorer Speech Add-In ou SAPI 5.1.

Sinon télécharger (6Mb) :
http://www.members.lycos.co.uk/moralmike/sapi5.msi
http://www.aldostools.com/sapi51.msi
(Il faut télécharger aussi l'installateur Microsoft si vous ne pouvez pas lancer les fichiers MSI)
[/INDENT] Voix de synthèse supplémentaires:

[INDENT]Si vous n'avez pas les voix Mary et Mike (si vous avez Windows XP) alors on peut les obtenir ici :
http://www.aldostools.com/sapi51xp.msi
(Il faut télécharger aussi l'installateur Microsoft si vous ne pouvez pas lancer les fichiers MSI)

Si vous voulez aussi les voix Michael et Michelle alors
vous devez installer les lecteur Microsoft e-book Reader,
puis installer Microsoft Reader Speech pack
et éventuellement désinstaller Microsoft e-book Reader.
[/INDENT]
Si vous voulez des voix de haute qualité réalistes :
[INDENT] vous pouvez essayer les versions de démonstration de la société Cepstral voices.
Pour télécharger les démos : http://www.cepstral.com/demos/
(ajout Hellfrog : un mail est requis je crois)
Les voix qui sont dans des fichiers de 20Mb ne sont pas terribles, mais les voix
des fichiers de 100Mb et 60Mb sont fantastiques.
Les versions démo ajoutent un message de pub au texte lu. La license légale coûte seulement $30.
Si vous pouvez trouver d'autres langues que l'anglais sur internet, mais Glovepie n'affiche
pour l'instant que les polices occidentales.[/INDENT]
[SIGPIC]http://www.kirikoo.net/images/8WoodMAn- ... 212448.png[/img][/SIGPIC] (\_/) (_'.') ..i72600k@4.5GHz + AsusSabertoothZ77 + 16Go GSkill10700 + AC Noctua + Raptor + Win7x64Ult + WH MFDs SaitekThr 1920x1080x3 dt 1 tactile 6950 2G
(")_(")
[/align]
Avatar de l’utilisateur

Topic author
hellfrog
Messages : 5117
Inscription : 22 août 2008

INSTALL GLOVEPIE + PPJoy

#3

Message par hellfrog »

GlovePIE
http://carl.kenner.googlepages.com/glovepie_download

- en téléchargeant ce gros fichier sur le site AVSIM [N.D.T. : inscription obligatoire]
http://library.avsim.net/search.php?...CatID=miscmisc
dans lequel PPJOY et Glovepie sont inclus.
mots clés : "X52, Glide, Winx3D, and GlovePIE Profiles V11"


ajout : traduction de parties du fichier lisez-moi de Glovepie,
non inclus dans le post original, ça peut intéresser les lecteurs)

- GlovePIE de Carl Kenner

PIE signifie Programmable Input Emulator = émulateur d'entrées programmable ;
Glove signifie gant, parce que c'est un soft initialement créé pour servir d'interface pour des gants de réalité virtuelles.

Limite d'utilisation :
(extrait de la License (n'engage que l'auteur Carl Kenner et l'utilisateur éventuel, je ne fait que traduire)) :
[...]Il est interdit d'utiliser glovePIE pour les jeux de combat permettant à l'Armée [(américaine ?)] de recruter de
futurs combattants parmi les joueurs, y compris America’s Army.
[...] Il est interdit d'exporter GlovePIE en Israël tant que cet état occupera des territoires en Syrie, à Gazza,
et au Liban [...]


Pour installer GlovePIE il faut DirectX 8 ou supérieur
(inclus dans Windows XP et la plupart des jeux)
http://www.microsoft.com/windows/directx/default.aspx

Image
Image

PPJoy
http://ppjoy.bossstation.dnsalias.org/
http://www.geocities.com/deonvdw/PPJoy.htm

[Ces liens ne sont plus valables : MAJ du 21/01/09 : trouvé ici :
http://ppjoy.10001downloads.com/
http://www.filetransit.com/view.php?id=63044
http://download-free.programas-gratis.n ... PPJoy-0.83]


- PPJoy : ce soft crée un joystick virtuel sur port parralèle

Image
[SIGPIC]http://www.kirikoo.net/images/8WoodMAn- ... 212448.png[/img][/SIGPIC] (\_/) (_'.') ..i72600k@4.5GHz + AsusSabertoothZ77 + 16Go GSkill10700 + AC Noctua + Raptor + Win7x64Ult + WH MFDs SaitekThr 1920x1080x3 dt 1 tactile 6950 2G
(")_(")
[/align]
Avatar de l’utilisateur

Topic author
hellfrog
Messages : 5117
Inscription : 22 août 2008

CREATION joystick virtuel sous PPJoy

#4

Message par hellfrog »

1 - Créer un nouveau joystick
-Lancez PPJoy : écran d'accueil :

Image

2 - Définir ou modifier le 'Mapping'
- après clic sur add en cas de création d'un nouveau controleur ou après clic sur mapping en cas de
modification d'un controler existant on obtient

Image

3 - Créer les axes :
on crée ici un joystick virtuel à 8 axes et 1 hat et 32 boutons :

ATTENTION : les noms des axes correspondent à la configuration du cougar qui est dans les posts suivant (cela peut être différent avec d'autres joysticks ...Saitek...)

4 - Définir les types d'axes

Image

Image

5 - Définir les boutons éventuels

Image

6 - Définir les POV HAT éventuels

Image

7 - ouf c'est tout pour l'instant : confirmez et créez le joystick virtuel

Image

Image

ensuite il vaut mieux rebooter la machine pour une bonne détection du nouveau périphérique, c'est facultatif pour une création, mais conseillé pour une modification du mapping d'un périphérique existant (expérience personnelle : avant de dire que ça ne marche pas, soyez certains que windows a bien détecté votre PPJoy dans les propriétés des controleurs de jeux)

cas d'un joystick à 8 axes sans boutons ni hat :
Image
pas de boutons
Image

cas d'un joystick à 8 axes, 0 boutons, 1 hat :

Image

Image


cas d'un "joystick" à 32 boutons sans axes ni hat :

Image

Image

Image
(ci - dessus : utilisez la roulette de la souris pour monter et descendre dans les listes déroulantes ça va plus vite)

et ainsi de suite pour tous les boutons ...
Image

on peut en créer plusieurs différents :

Image
Pièces jointes
ppjoy.definir stick.5.jpg
ppjoy.definir stick.4.jpg
ppjoy.definir stick.3.jpg
ppjoy.definir stick.2.jpg
ppjoy.definir stick.jpg
[SIGPIC]http://www.kirikoo.net/images/8WoodMAn- ... 212448.png[/img][/SIGPIC] (\_/) (_'.') ..i72600k@4.5GHz + AsusSabertoothZ77 + 16Go GSkill10700 + AC Noctua + Raptor + Win7x64Ult + WH MFDs SaitekThr 1920x1080x3 dt 1 tactile 6950 2G
(")_(")
[/align]
Avatar de l’utilisateur

Topic author
hellfrog
Messages : 5117
Inscription : 22 août 2008

#5

Message par hellfrog »

la suite : images 5 -6 -7
Pièces jointes
ppjoy.definir stick.7.jpg
ppjoy.definir stick.6.jpg
ppjoy.definir stick.5.jpg
[SIGPIC]http://www.kirikoo.net/images/8WoodMAn- ... 212448.png[/img][/SIGPIC] (\_/) (_'.') ..i72600k@4.5GHz + AsusSabertoothZ77 + 16Go GSkill10700 + AC Noctua + Raptor + Win7x64Ult + WH MFDs SaitekThr 1920x1080x3 dt 1 tactile 6950 2G
(")_(")
[/align]
Avatar de l’utilisateur

Topic author
hellfrog
Messages : 5117
Inscription : 22 août 2008

Calibrer dans Glovepie PPJoy - Cougar

#6

Message par hellfrog »

script Glovepie pour faire correspondre Cougar et PPJoy.Joystick virtuel que l'on vient de créer :

///// DEBUT DU SCRIPT
//// Avis aux programmeurs :
////
//// OBJECTIF DE CE SCRIPT : Emulation du cougar par Glovepie
////
//// le but de ce script est d'être pédagogique, et non pas fonctionnel. (il marche pour étalonner mais ne fait rien d'autre)
////
//
// Viewer cougar : ..........COUGAR.Foxy ......GlovePIE - PPjoy ................script
// axe X .......................Stick JOY_X............. x.................. PPJoy1.Analog1 = Joystick1.x
// axe Y .......................Stick JOY_Y..............y.................. PPJoy1.Analog2 = Joystick1.y
// axe Z ....................... throttle THR.............z.................. PPJoy1.Analog3 = Joystick1.z
// axe S1 ....................... range RNG ...........pitch ...............PPJoy1.Analog7 = Joystick1.pitch
// axe XR ....................... antenne ANT...........slider ............PPJoy1.Analog5 = Joystick1.slider
// axe ZR ....................... rudder RDDR ...........roll ...............PPJoy1.Analog4 = Joystick1.roll
// axe YR ....................... Pinkie MSY ...........yaw ................PPJoy1.Analog6 = Joystick1.yaw
// axe S2 ....................... Pinkie MSX ............dial ................PPJoy1.Analog8 = Joystick1.dial
//
// n'utilisez pas : vx vy vz vslider vyaw VRot vroll vpitch vdial Saturation Rot
//
var.Name = joystick1.Name //
var.NbAxes = joystick1.NumberOfAxes // 8
var.NbPOV = joystick1.NumberOfPOVs // 1
var.NbBtns = joystick1.NumberOfButtons // 28
//
PPJoy1.Analog1 = Joystick1.x
PPJoy1.Analog2 = Joystick1.y
PPJoy1.Analog3 = Joystick1.z
PPJoy1.Analog4 = Joystick1.roll
PPJoy1.Analog5 = Joystick1.slider
PPJoy1.Analog6 = Joystick1.yaw
PPJoy1.Analog7 = Joystick1.pitch
PPJoy1.Analog8 = Joystick1.dial
//
//// l'appui sur un bouton du Cougar est transmis dans la valeur var.Cougar[NomBouton] correspondante
//Cougar:
var.CougarTG1 = Joystick1.Button1
var.CougarS2 = Joystick1.Button2 //4
var.CougarS3 = Joystick1.Button3 //5
var.CougarS4 = Joystick1.Button4 //6
var.CougarS1 = Joystick1.Button5 //3
var.CougarTG2 = Joystick1.Button6 //2
//
// var.CougarH1U = Joystick1.Button7 // POV dans PPJoy
// var.CougarH1R = Joystick1.Button8 // POV dans PPJoy
// var.CougarH1D = Joystick1.Button9 // POV dans PPJoy
// var.CougarH1L = Joystick1.Button10 // POV dans PPJoy
//
PPJoy1.Digital1 = Joystick1.Pov1Up
PPJoy1.Digital3 = Joystick1.Pov1Left
PPJoy1.Digital5 = Joystick1.Pov1Down
PPJoy1.Digital7 = Joystick1.Pov1Right
//
var.CougarH2U = Joystick1.Button7
var.CougarH2R = Joystick1.Button8
var.CougarH2D = Joystick1.Button9
var.CougarH2L = Joystick1.Button10
var.CougarH3U = Joystick1.Button11
var.CougarH3R = Joystick1.Button12
var.CougarH3D = Joystick1.Button13
var.CougarH3L = Joystick1.Button14
var.CougarH4U = Joystick1.Button15
var.CougarH4R = Joystick1.Button16
var.CougarH4D = Joystick1.Button17
var.CougarH4L = Joystick1.Button18
var.CougarT1 = Joystick1.Button19
var.CougarT2 = Joystick1.Button20 //Dn
var.CougarT3 = Joystick1.Button21 //Up
var.CougarT4 = Joystick1.Button22 //Rgt
var.CougarT5 = Joystick1.Button23 //Lft
var.CougarT6 = Joystick1.Button24
var.CougarT7 = Joystick1.Button25
var.CougarT8 = Joystick1.Button26
var.CougarT9 = Joystick1.Button27
var.CougarT10 = Joystick1.Button28
//
////// FIN DU SCRIPT



Vous pouvez copier - coller ce script dans glovepie, (puis sauvegarder... ben oui, ça peut servir...)
puis lancez - le : menu 'Run ou 'Executer (suivant la langue sélectionnée dans 'menu 'option)

Image

cliquez sur l'onglet 'variables et vous devez avoir ceci :

Image
Pièces jointes
Glovepie.VarBtns.jpg
[SIGPIC]http://www.kirikoo.net/images/8WoodMAn- ... 212448.png[/img][/SIGPIC] (\_/) (_'.') ..i72600k@4.5GHz + AsusSabertoothZ77 + 16Go GSkill10700 + AC Noctua + Raptor + Win7x64Ult + WH MFDs SaitekThr 1920x1080x3 dt 1 tactile 6950 2G
(")_(")
[/align]
Avatar de l’utilisateur

Topic author
hellfrog
Messages : 5117
Inscription : 22 août 2008

Configuration du Cougar

#7

Message par hellfrog »

Pièces jointes
cougar.Viewer.jpg
cougar.ccp.jpg
[SIGPIC]http://www.kirikoo.net/images/8WoodMAn- ... 212448.png[/img][/SIGPIC] (\_/) (_'.') ..i72600k@4.5GHz + AsusSabertoothZ77 + 16Go GSkill10700 + AC Noctua + Raptor + Win7x64Ult + WH MFDs SaitekThr 1920x1080x3 dt 1 tactile 6950 2G
(")_(")
[/align]
Avatar de l’utilisateur

Topic author
hellfrog
Messages : 5117
Inscription : 22 août 2008

Tests

#8

Message par hellfrog »

alors pour commencer,

quand vous êtes dans l'onglet 'variables' de glovepie avec le script en cours d'exécution :[INDENT]- vous voyez qu'à chaque pression d'un bouton du cougar la variable dans laquelle est stocké l'état du bouton prend la valeur TRUE quand il est enfoncé, FALSE quand il est relaché.

Image
[/INDENT]- vous pouvez donc utiliser ce script et ces variables dont les noms sont explicites pour faire vos programmation, sans utiliser foxy.


- Utilisation des boutons :[INDENT]- vous pouvez utiliser le cougar en mode directX windows (CCP : bouton est rouge) + glovepie
- vous pouvez utiliser cougar + TMJ de foxy chargé + mode émulation (le bouton est vert dans le CCP) Et si vous utilisez glovepie vous risquez d'avoir des doublons ou des problèmes

- dans vos jeux vous pouvez affecter directement une fonction à un bouton du joystick COUGAR
OU
à un bouton du joystick PPjoy si vous lui avez mis des boutons (ce n'est pas le cas de l'exemple mis en image ci-dessous, et il n'ya pas d'instructions pour ces boutons là dans mon script ci-dessous, mais c'est faisable)
OU
à rien du tout et c'est le cougar par le TMJ chargé par foxy et le mode émulation actif qui émule la frappe du bouton
OU
à rien du tout et c'est le script de glovepie qui émule la frappe du bouton
[/INDENT]- utilisation des axes :[INDENT]- lancez le script dans glovepie

Image

- lancez démarrer / paramètres / panneau de configuration / contrôleurs de jeux

- vous avez la fenetre image-1-

Image

- déplacez là au milieu en haut sur votre écran

- si vous cliquez sur HOTAS cougar et sur le bouton propriétés vous allez ouvrir le viewer (idem que par le CCP, bouton viewer)

Image

- déplacez un peu cette fenetre en bas à gauche

- retournez sur la fenetre-1 et faites clic sur PPJoy Virtual Joystick 1 puis sur le bouton propriétés : vous ouvrez la fenetre image-3-

Image

- en déplaçant le stick et tous les rotaries et le pinkie et les pedales, vous devez voir chaque jauge bouger sur les propriétés du cougar (viewer) ET du PPJoystick virtuel

- mais il nous faut l'étalonner ce joy virtuel : image-1
puis image -4

Image

- perso je conseilles de NE PAS affecter les axes du cougar à PPJoy car moins précis et moins sensible que direct avec le cougar ; MAIS ça peut être intéressant si on veut programmer des axes en particulier (gérer des moteur différents avec un seul throttle, programmer des réverses ou une sortie de volets etc..., mais on peut aussi utiliser des variables qui lisent les valeurs des axes de joystik1 = le cougar, bref c'est affaire de choix...)

voila c'est tout pour aujourd'hui.................................. comme disait le Shadock C. Piéplu lol
si vous êtes sages , dans les jours qui viennent , au menu on aura : comment transformer les instructions d'un fichier TMJ en langage glovepie
[/INDENT]
Pièces jointes
ppjoy.definir stick.etalonner.jpg
win_parma_config_joysticks.ppjoy.jpg
cougar.Viewer.jpg
win_parma_config_joysticks.jpg
[SIGPIC]http://www.kirikoo.net/images/8WoodMAn- ... 212448.png[/img][/SIGPIC] (\_/) (_'.') ..i72600k@4.5GHz + AsusSabertoothZ77 + 16Go GSkill10700 + AC Noctua + Raptor + Win7x64Ult + WH MFDs SaitekThr 1920x1080x3 dt 1 tactile 6950 2G
(")_(")
[/align]

Lokan_Ratum
Nouvelle Recrue
Nouvelle Recrue
Messages : 115
Inscription : 06 juin 2008

#9

Message par Lokan_Ratum »

Bonjour,

pour la reconnaissance vocale, il y a aussi Flight Assistant, disponible sur http://www.thelindercompany.de/.

Il fonctionne parfaitement bien, à condition bien sûr de disposer du SAPI 5.1 et de faire un peu d'entraînement, que le logiciel se familiarise à votre voix.

Lokan

Mahakam
Jeune Pilote
Jeune Pilote
Messages : 1553
Inscription : 03 décembre 2004

#10

Message par Mahakam »

Super boulot, Hellfrog, merci beaucoup... et félicitations ! :yes:
Avatar de l’utilisateur

Topic author
hellfrog
Messages : 5117
Inscription : 22 août 2008

Emulation des fonctions cougar

#11

Message par hellfrog »

aujourd'hui, la suite : comment transformer la syntaxe cougar foxy *.TMM et *.TMJ en script glovePIE ?

listing ci-dessous

mais comme les tabulations sont " mangées " j'ai remis le fichier txt en lien en bas.
suffit de lire, c'est auto commenté.

inclus : légère mise à jour du script du post #5.



//// Avis aux programmeurs :
////
//// OBJECTIF DE CE SCRIPT : Emulation du cougar par Glovepie
////
//// le but de ce script est d'être pédagogique, et non pas fonctionnel.
////
//
// Viewer cougar : COUGAR Foxy GlovePIE - PPjoy script
// axe X Stick JOY_X x PPJoy1.Analog1 = Joystick1.x
// axe Y Stick JOY_Y y PPJoy1.Analog2 = Joystick1.y
// axe Z throttle THR z PPJoy1.Analog3 = Joystick1.z
// axe S1 range RNG pitch PPJoy1.Analog7 = Joystick1.pitch
// axe XR antenne ANT slider PPJoy1.Analog5 = Joystick1.slider
// axe ZR rudder RDDR roll PPJoy1.Analog4 = Joystick1.roll
// axe YR Pinkie MSY yaw PPJoy1.Analog6 = Joystick1.yaw
// axe S2 Pinkie MSX dial PPJoy1.Analog8 = Joystick1.dial
//
// n'utilisez pas : vx vy vz vslider vyaw VRot vroll vpitch vdial Saturation Rot
//
var.Name = joystick1.Name //
var.NbAxes = joystick1.NumberOfAxes // 8
var.NbPOV = joystick1.NumberOfPOVs // 1
var.NbBtns = joystick1.NumberOfButtons // 28
//
// US : Use these ones below if you want to map cougar axes to PPJoy axes
// FR : Utilisez les calibrages suivant si vous souhaitez mapper des axes du cougar sur le joystick virtuel
PPJoy1.Analog1 = Joystick1.x
PPJoy1.Analog2 = Joystick1.y
PPJoy1.Analog3 = Joystick1.z
PPJoy1.Analog4 = Joystick1.roll
PPJoy1.Analog5 = Joystick1.slider
PPJoy1.Analog6 = Joystick1.yaw
PPJoy1.Analog7 = Joystick1.pitch
PPJoy1.Analog8 = Joystick1.dial
//
// Fr :Pour utiliser les valeurs numériques renvoyées par les axes du cougar, utilisez les variables suivantes :
// US : to read cougar axes values, use these ones :
var.CougarX = Joystick1.x
var.CougarY = Joystick1.y
var.CougarThr = Joystick1.z
var.CougarRddr = Joystick1.roll
var.CougarMSX = Joystick1.dial
var.CougarMSY = Joystick1.yaw
var.CougarRNG = Joystick1.pitch
var.CougarANT = Joystick1.slider
//
//// l'appui sur un bouton du Cougar est transmis dans la valeur var.Cougar[NomBouton] correspondante
// US : Use the values below if you want to monitor cougar buttons press
// FR : Utilisez les variables suivantes si vous voulez suivre les actions des boutons du cougar
// //Cougar:
var.CougarTG1 = Joystick1.Button1
var.CougarS2 = Joystick1.Button2 //4
var.CougarS3 = Joystick1.Button3 //5
var.CougarS4 = Joystick1.Button4 //6
var.CougarS1 = Joystick1.Button5 //3
var.CougarTG2 = Joystick1.Button6 //2
// var.CougarH1U = Joystick1.Button7 // POV dans PPJoy
// var.CougarH1R = Joystick1.Button8 // POV dans PPJoy
// var.CougarH1D = Joystick1.Button9 // POV dans PPJoy
// var.CougarH1L = Joystick1.Button10 // POV dans PPJoy
PPJoy1.Digital1 = Joystick1.Pov1Up
PPJoy1.Digital3 = Joystick1.Pov1Left
PPJoy1.Digital5 = Joystick1.Pov1Down
PPJoy1.Digital7 = Joystick1.Pov1Right

[EDIT 28/02]
var.CougarH1U = Joystick1.Pov1Up // analog not True or False
var.CougarH1L = Joystick1.Pov1Left // analog not True or False
var.CougarH1D = Joystick1.Pov1Down // analog not True or False
var.CougarH1R = Joystick1.Pov1Right // analog not True or False
var.CougarH1UL = (var.CougarH1U and var.CougarH1L) and not (var.CougarH1U and not var.CougarH1L) and not (var.CougarH1L and not var.CougarH1U)
var.CougarH1UR = (var.CougarH1U and var.CougarH1R) and not (var.CougarH1U and not var.CougarH1R) and not (var.CougarH1R and not var.CougarH1U)
var.CougarH1DR = (var.CougarH1D and var.CougarH1R) and not (var.CougarH1D and not var.CougarH1R) and not (var.CougarH1R and not var.CougarH1D)
var.CougarH1DL = (var.CougarH1D and var.CougarH1L) and not (var.CougarH1D and not var.CougarH1L) and not (var.CougarH1L and not var.CougarH1D)

var.CougarH2U = Joystick1.Button7
var.CougarH2R = Joystick1.Button8
var.CougarH2D = Joystick1.Button9
var.CougarH2L = Joystick1.Button10
var.CougarH3U = Joystick1.Button11
var.CougarH3R = Joystick1.Button12
var.CougarH3D = Joystick1.Button13
var.CougarH3L = Joystick1.Button14
var.CougarH4U = Joystick1.Button15
var.CougarH4R = Joystick1.Button16
var.CougarH4D = Joystick1.Button17
var.CougarH4L = Joystick1.Button18
var.CougarT1 = Joystick1.Button19
var.CougarT2 = Joystick1.Button20 //Dn
var.CougarT3 = Joystick1.Button21 //Up
var.CougarT4 = Joystick1.Button22 //Rgt
var.CougarT5 = Joystick1.Button23 //Lft
var.CougarT6 = Joystick1.Button24
var.CougarT7 = Joystick1.Button25
var.CougarT8 = Joystick1.Button26
var.CougarT9 = Joystick1.Button27
var.CougarT10 = Joystick1.Button28
//
//
//////************ Programmation du Joystick "à la manière" de foxy dans un fichier TMJ:

var.BeepGrave => Beep(500hz, 10ms)
var.BeepAigue => Beep(7000hz, 10ms)

//// pour créer le script glovepie il suffit ensuite d'affecter la touche voulue à la variable correspondante :

// BTN TG1 ENT
// s'écrirait ainsi à la suite du script précédent (définition des boutons et des variables) :
// key.ENTER = var.CougarTG1
//
// ou encore la syntaxe suivante est équivalente :
// var.CougarTG1 => ENTER
//
// on peut facilement remapper des touches :
// var.a = swallow(key.U)
// var.a => B
// ce script simple produit le résultat suivant : frappez 'u' au clavier, renvoie la frappe de 'b'
// pour tester, lancer le script et ouvrir notepad puis tapper u
//
//************ SHIFT actif /I **********************************
//
// on utilise la variable var.Cougar_I ou simplement var.CougarS3, sans créer de nouvelle variable
var.Cougar_I = var.CougarS3
if var.CougarS3 then
var.BeepGrave = True
say("Cougar Shift is S3")
say("First physical Joystick Cougar Button S Three is pressed")
endif
//
// BTN H1U //I UARROW dans un fichier TMJ s'écrirait ainsi dans ce script :
// key.UpArrow = (var.CougarH1U AND var.CougarS3)
//
//************ Cougar Boutons T7 et T8 utilisés pour /U /M /D **********************************
//
// on peut utiliser les valeurs logiques suivantes :
// var.Cougar_U est vrai si T7 et pas T8 donc /U
// var.Cougar_M est vrai si pas T7 et pas T8 donc /M
// var.Cougar_D est vrai si T8 et pas T7 donc /D
//
var.Cougar_U = var.CougarT7 and (not var.CougarT8)
var.Cougar_M = (not (var.CougarT7 and var.CougarT8))
var.Cougar_D = (not var.CougarT7) and var.CougarT8
//
// c'est tout, cela suffit comme code.
// on utilisera par exemple pour
// BTN S4 /U : (var.CougarS4 and var.Cougar_U) est vrai
// if var.CougarS4 and var.Cougar_U then
//
//------ ROKKER Centered = NOT T7 AND NOT T8 = //M
//
//if (not (var.CougarT7 and var.CougarT8)) then
// say("Cougar Rokker centered Tee Seven and Tee Eight are all Up")
//endif
//if released(var.CougarT7) OR released(var.CougarT8) then
// var.Cougar_U = False
// var.Cougar_M = True
// var.Cougar_D = False
//endif
//
//------ ROKKER UP = T7 = //U
//if var.CougarT7 and (not var.CougarT8) then
// var.BeepGrave = true
// say("Cougar Rokker Up Tee Seven is Down")
// var.Cougar_U = True
// var.Cougar_M = False
// var.Cougar_D = False
//end if
//
//------ ROKKER DN = T8 = //D
//if var.CougarT8 and (not var.CougarT7) then
// var.BeepAigue = True
// say("Cougar Rokker Down Tee Eight is Down")
// var.Cougar_U = False
// var.Cougar_M = False
// var.Cougar_D = True
//end if
//
//************ S2 /H DLY(60) A **********************************
// cette fonction pas assez utilisée et bien pratique entraîne l'autorépétition de 'a'
// toutes les 60 msec tant que S2 est appuyé
if (var.CougarS2 and HeldDown(var.CougarS2, 500ms)) then
press key.a
release key.a
Wait 60 ms
end if
// [EDIT 05/02]
// fonction /H
: tant que le touche est appuyée, répétition
// Dans cet exemple, U clavier déclenche U, tant que U est maintenu, le clavier renvoie U.
var.U = swallow(key.U)
if var.U and not var.Key_U_Downed then
var.Key_U_Downed = true
press(key.U)
end if
if NOT var.U then
var.Key_U_Downed = false
release(key.U)
end if
//
// S4 entraine frein de roues
if var.CougarS4 AND NOT var.Key_S4_Downed then
var.Key_S4_Downed = True
press(var.Brake_Wheel)
end if
if NOT var.CougarS4 then
var.Key_S4_Downed = False
release(var.Brake_Wheel)
end if
//
// Précision pour les newbies :
// Différence entre /A et /H dans foxy :
// S2 /A "U" renvoie si S2 est maitenu : KD("U") KU("U") répétés : comme si on tapote la touche de manière répétée
// S2 /H "U" renvoie si S2 est maintenu : KD("U").......... rien ...puis ... KU("U") quand S2 est relâché : comme si on maintient la touche sans la relâcher (fonction autorepeat du clavier, dont la fréquence se règle dans les paramètres de windows ou dans GlovePIE).
//
// [FIN EDIT 05/02]

//
//
// ******************** PULSE action pendant 300 msec toutes les 700 msec
// en français :
// copiez ce script dans GlovePIE
// (vous pouvez remplacer 'var.CougarS4' par 'key.Pause' pour tester sans le cougar avec le clavier et la touche Pause
// A l'excécution, ouvrez Notepad et un document vierge.
// A l'appui de S4 maintenu pendant plusieurs secondes vous aurez :
// un son grave toutes les 700 msec, un son aiguë répété pendant 300 msec, la frappe de A ou q (US/Fr) pendant 300 msec
// environ 8 x A pendant 300 msec = ttoutes les 60-65 msec = temps d'exécution du script sur Athlon 2GHz
// in english (bad) :
// copy this script in glovePIE
// (you may replace var.CougfarS4 with key.Pause to test it without Cougar and with keyboard only)
// if you run this script, open notepad en maintain depressed long time key pause :
// you will ear boooouup each 700 ms and after that you will ear biiiip 8 times so
// each 60 ms ( near 300 msec / 60 msec (60 msec is time for program execution in memory) Athlon 2GHz
// and you will have a A (US keyboard) or q (french keyboard) input in your document at each time
//
if var.CougarS4 and HeldDown(var.CougarS4, 700ms) then
// start thread for 300 ms
if var.S4_Action then // start action
Beep(7000hz, 10ms)
Press(Key.A)
end if
end if
if var.CougarS4 AND HeldDown(var.CougarS4, 700ms) AND HeldDown(A, 300ms) AND var.S4_Action then
// end action after 300 ms
release(Key.A)
Beep(500hz, 10ms)
var.S4_Action = False // start pause
end if
if var.CougarS4 and HeldDown(var.CougarS4, 700ms) and helddown((not var.S4_Action), 700ms) then
// new thread each 700 ms
var.S4_Action = True // start action
end if
//
//************ Programmation logique PULSE () ************************************
//---DEF X10 PULSE(60 120) X2
// BTN X10 A
// si X2 est vrai alors X10 sera vrai pendant 60 msec, (émule la touche A)
// puis faux pendant 120 msec, puis la boucle recommence
// reprend le script précédent, adapté :
//
Key.A = var.X10
if var.X2 AND HeldDown(var.X2, 60ms) then
if var.PulseX2_Action then
Press var.X10
var.X10 = True
end if
end if
if var.X2 AND HeldDown(var.X10, 60ms) AND var.PulseX2_Action Then
Release var.X10
var.X10 = False
var.PulseX2_Action = False
end if
if var.X2 AND HeldDown((NOT var.PulseX2_Action), 120ms) then
var.PulseX2_Action = True
end if
//
///////////////////////////////////////////////////////////////////////////////////////////////
//
////////// QQS exemples d'application ci-dessous
//
////////// BTN H3U /O /P View_Target /R View_Pit
if (var.CougarH3U AND NOT var.CougarS3) then
if var.View_Pit then
press(key.p)
release(key.p)
wait 300ms
//var.View_Target = true
//var.View_Pit = false
else
press(key.t)
release(key.t)
wait 300ms
//var.View_Pit = true
//var.View_Target = false
end if
end if
//
////////////////// EJECTION
////// maintenir S4 + S3 + S1 0.7 sec pour déclencher l'ejection ou bien dire "Eject Eject"
if HeldDown(var.CougarS4 AND var.CougarS3 AND var.CougarS1, 700ms) Then
var.Gnl_Eject = true
end if
if (var.Gnl_Eject OR SAID("Eject Eject")) then
Press(key.LeftControl)
wait(65ms)
Press(key.e)
wait(65ms)
Press(key.e)
wait(65ms)
Press(key.e)
wait(65ms)
Release(key.e)
wait(65ms)
Release(key.e)
wait(65ms)
Release(key.e)
wait(65ms)
Release(key.LeftControl)
say("Mayday Mayday Mayday Ejecting")
wait 500 ms
end if
//
////////////////////////////
// key.Break correspond à {CTRL + Pause}
//
// syntax ok :
//(var.pit = true) => (press(key.P), wait(30ms), release(key.P))
Pièces jointes
Cougar_Emulateur.00.01.txt
(6.33 Kio) Téléchargé 307 fois
_mercredi.PIE.Cougar_Emulateur.tmj_translate.00.01.txt
(11.38 Kio) Téléchargé 297 fois
[SIGPIC]http://www.kirikoo.net/images/8WoodMAn- ... 212448.png[/img][/SIGPIC] (\_/) (_'.') ..i72600k@4.5GHz + AsusSabertoothZ77 + 16Go GSkill10700 + AC Noctua + Raptor + Win7x64Ult + WH MFDs SaitekThr 1920x1080x3 dt 1 tactile 6950 2G
(")_(")
[/align]
Avatar de l’utilisateur

Topic author
hellfrog
Messages : 5117
Inscription : 22 août 2008

QQS exemples pour BlackShark : Armement et TG1 TG2

#12

Message par hellfrog »

toujours pareil, perte des tabulations : moins lisible

donc tjrs en lien en bas


NB : il faut ajouter le script du post #5 (pour les définitions des variables avant pour que ça marche) : je raccourci pour que ça reste lisible


//
/////// ****** TRIGGERS ***************************************************************************
//
////// ------------------------- GlovePIE script
//
// Au menu ci-dessous : 3 scripts différents pour une gestion différente des TG1 et TG2 et S2 et S1
// car ces boutons sont souvent utilisés pour la gestion de l'armement avec le Cougar
// mais les goûts de chacun diffèrent...
//
//
// Premier script ****************************************************
// ici : TG1 => feu missiles ou roquettes, maintenir 1 sec pour Vikhr
// TG2 => feu canon

//
key.RightAlt+key.Space = var.Wpn_Current_Release
key.Space = var.Wpn_Gun_fire
// TG1 only
if (HeldDown(var.CougarTG1, 60ms) AND NOT (Pressed(var.CougarTG2) OR HeldDown(var.CougarTG2, 30ms))) then
press var.Wpn_Current_Release
end if
if released(var.CougarTG1) then
release var.Wpn_Current_Release
end if
// TG2 only
if HeldDown(var.CougarTG2, 30ms) then
press var.Wpn_Gun_Fire
end if
if Released(var.CougarTG2) then
release var.Wpn_Gun_Fire
end if
// fin 1er script -----------------------
// equivalent foxy _ 1er script
//---------------- Cougar -.TMM
// Wpn_Current_Release = USB (DE6 D2C U2C UE6) Rem RAlt SPC
// Wpn_Gun_Fire = SPC
// Wpn_Gun_Select = c
//
//---------------- Cougar -.TMJ
// BTN TG1 /P Wpn_Current_Release_Pres Rem maintain up to 1 sec to fire Vikhr
// /R Wpn_Current_Release_Rel
// BTN TG2 /P Wpn_Current_Release_Rel Wpn_Gun_Select KD(Wpn_Gun_Fire)
// /R KU(Wpn_Gun_Fire)
//----------------
//
// Second script **********************************************
// ici _ TG1 bref => rien
// TG1 long ( > 0.4 sec) sans TG2 => mode canon ou mode missile toggle + say
// TG2 => Feu arme sélectionnée

//
key.RightAlt+key.Space = var.Wpn_Current_Release
key.Space = var.Wpn_Gun_fire
// TG1 only
if (HeldDown(var.CougarTG1, 400ms) AND NOT (Pressed(var.CougarTG2) OR HeldDown(var.CougarTG2, 30ms))) then
Toggle(var.WeaponIsGun)
end if
// To re initialize in case of error
if SAID("Weapon is GUN") then
var.WeaponIsGun = True
Say("Gun active")
end if
if SAID("Weapon is NOT GUN") OR SAID("Weapon is Vikr") OR SAID("Weapon is Rockets") OR SAID("Weapon is Bombs") OR SAID("Weapon is Fuel") then
var.WeaponIsGun = False
Say("Gun Not active")
end if
// TG2 only
if HeldDown(var.CougarTG2, 30ms) then
if var.WeaponIsGun then
press var.Wpn_Gun_Fire
else
press var.Wpn_Current_Release
end if
end if
if Released(var.CougarTG2) then
release var.Wpn_Gun_Fire
release var.Wpn_Current_Release
end if
// fin 2ème script ---------------------
//
// 3ème script *******************************************
// ici _ TG1 => target lock
// TG2 => fire gun
// S2 => Fire Weapon

//
key.RightAlt+key.Space = var.Wpn_Current_Release
key.Space = var.Wpn_Gun_fire
Key.Enter = var.Target_Lock
// TG1 only
if (HeldDown(var.CougarTG1, 30ms) AND NOT (Pressed(var.CougarTG2) OR HeldDown(var.CougarTG2, 30ms))) then
press(var.Target_Lock)
end if
if released(var.CougarTG1) then
release(var.Target_Lock)
end if
// TG2 only
if HeldDown(var.CougarTG2, 30ms) then
press var.Wpn_Gun_Fire
end if
if Released(var.CougarTG2) then
release var.Wpn_Gun_Fire
end if
// S2 only
if HeldDown(var.CougarS2, 30ms) then
press var.Wpn_Current_Release
end if
if Released(var.CougarS2) then
release var.Wpn_Current_Release
end if
// fin 3ème script -----------------
//
//
// ******** Script pour BOUTON S1 pour sélection des armes actives ****************************
//
Key.i = var.Wpn_Select_Inward
Key.y = var.Wpn_Select_Outward
Key.u = var.Wpn_Select_All
key.LeftControl+key.u = var.Wpn_Select_AAMode
if pressed(var.CougarS1) Then
if var.Wpn_Selection > 4 then
var.Wpn_Selection=1
end if
if var.Wpn_Selection =1 then
press(var.Wpn_Select_Inward)
wait 60ms
release(var.Wpn_Select_Inward)
Inc(var.Wpn_Selection)
end if
if var.Wpn_Selection =2 then
press(var.Wpn_Select_Outward)
wait 60ms
release(var.Wpn_Select_Outward)
Inc(var.Wpn_Selection)
end if
if var.Wpn_Selection =3 then
press(var.Wpn_Select_AAMode)
wait 60ms
release(var.Wpn_Select_AAMode)
Inc(var.Wpn_Selection)
end if
if var.Wpn_Selection =4 then
press(var.Wpn_Select_All)
wait 60ms
release(var.Wpn_Select_All)
Inc(var.Wpn_Selection)
end if
end if
// Avec S3 + S1 on parcours les Toggles en sens inverse
if pressed(var.CougarS1 AND var.CougarS3) Then
if var.Wpn_Selection < 1 then
var.Wpn_Selection=4
end if
if var.Wpn_Selection =1 then
press(var.Wpn_Select_Inward)
wait 60ms
release(var.Wpn_Select_Inward)
Dec(var.Wpn_Selection)
end if
if var.Wpn_Selection=2 then
press(var.Wpn_Select_Outward)
wait 60ms
release(var.Wpn_Select_Outward)
Dec(var.Wpn_Selection)
end if
if var.Wpn_Selection=3 then
press(var.Wpn_Select_AAMode)
wait 60ms
release(var.Wpn_Select_AAMode)
Dec(var.Wpn_Selection)
end if
if var.Wpn_Selection=4 then
press(var.Wpn_Select_All)
wait 60ms
release(var.Wpn_Select_All)
Dec(var.Wpn_Selection)
end if
end if
// Fin script S1 Weapon ------------------------------
//
//////----- END TRIGGERS
Pièces jointes
_01-28.BS.WeaponFiring.txt
(5.73 Kio) Téléchargé 272 fois
[SIGPIC]http://www.kirikoo.net/images/8WoodMAn- ... 212448.png[/img][/SIGPIC] (\_/) (_'.') ..i72600k@4.5GHz + AsusSabertoothZ77 + 16Go GSkill10700 + AC Noctua + Raptor + Win7x64Ult + WH MFDs SaitekThr 1920x1080x3 dt 1 tactile 6950 2G
(")_(")
[/align]

Rcaf_Frenchy
Mécano au sol
Mécano au sol
Messages : 523
Inscription : 10 septembre 2002

#13

Message par Rcaf_Frenchy »

Bonjour hellfrog pour ton info
//************ SHIFT actif /I **********************************
//
// on utilise la variable var.Cougar_I ou simplement var.CougarS3, sans créer de nouvelle variable
var.Cougar_I = var.CougarS3
if var.CougarS3 then
var.BeepGrave = True
say("Cougar Shift is S3")
say("First physical Joystick Cougar Button S Three is pressed")
endif
//
Je te conseille de rajouter une tempo (wait 2s) entre les Say ou de n'en faire qu'un car la commande Say n'attend pas la fin du message pour continuer à dérouler le script , si tu ne mets pas de tempo tu n'entendras jamais le premier message
dans une structure If - ENDIF action wait ne bloque pas tout le script mais simplement la partie correspondante au IF - ENDIF principal..En fait il faut considérer une structure IF/ENDIF comme un sous programme
//************ S2 /H DLY(60) A **********************************
// cette fonction pas assez utilisée et bien pratique entraîne l'autorépétition de 'a'
// toutes les 60 msec tant que S2 est appuyé
if (var.CougarS2 and HeldDown(var.CougarS2, 500ms)) then
press key.a
release key.a
Wait 60 ms
end if
//
Je supose que l'action est d'envoyer des leurres toutes les 60ms?
attention GLovepie utilise un format de clavier americain donc Key.a = touche q
il faut utiliser key.q pour gérer la touche A

voici une liste non complete des equivalents
key.a -> q
key.q -> a
key.w ->z
key.z -> w
key.Minus -> )
key.Equals -> =
key.Comma -> ;
key.Slash -> !
key.Semicolon -> m
key.Dot -> :
Frenchy Team Super Hornet
Image
Avatar de l’utilisateur

Topic author
hellfrog
Messages : 5117
Inscription : 22 août 2008

#14

Message par hellfrog »

Rcaf_Frenchy a écrit : voici une liste non complete des equivalents
key.a -> q
key.q -> a
key.w ->z
key.z -> w
key.Minus -> )
key.Equals -> =
key.Comma -> ;
key.Slash -> !
key.Semicolon -> m
key.Dot -> :
ça c'est comme dans foxy, pas de changement, on a l'habitude pour le cougar.
Rcaf_Frenchy a écrit : Je te conseille de rajouter une tempo (wait 2s) entre les Say ou de n'en faire qu'un car la commande Say n'attend pas la fin du message pour continuer à dérouler le script , si tu ne mets pas de tempo tu n'entendras jamais le premier message
dans une structure If - ENDIF action wait ne bloque pas tout le script mais simplement la partie correspondante au IF - ENDIF principal..En fait il faut considérer une structure IF/ENDIF comme un sous programme
Merci pour ton info :notworthy... c'est bon à savoir...

mais suscite une interrogation ::huh: si on a une exécution parallèle et que différentes parties du code délenchent à peu d'intervalle de temps un 'Say()' :
est-ce que certains sont 'mangés' ?
Cela oblige t-il à inclure une boucle de lecture des variables pour exécuter les 'Say' dans un ordre précis et avec temporisation ?
[SIGPIC]http://www.kirikoo.net/images/8WoodMAn- ... 212448.png[/img][/SIGPIC] (\_/) (_'.') ..i72600k@4.5GHz + AsusSabertoothZ77 + 16Go GSkill10700 + AC Noctua + Raptor + Win7x64Ult + WH MFDs SaitekThr 1920x1080x3 dt 1 tactile 6950 2G
(")_(")
[/align]

Rcaf_Frenchy
Mécano au sol
Mécano au sol
Messages : 523
Inscription : 10 septembre 2002

#15

Message par Rcaf_Frenchy »

Tout à fait ,

prends l'exemple de ce script
if var.a = 1 then
say("toto")
endif
if var.a = 2 then
say("tata")
endif
if var.a > 1 then
say("tutu")
endif
if var.a = 2 then var.a = 0
if u then var.a = 2
lorsque tu appuie sur la touche u tu dois entendre tata et tutu
or tu n'entends que tutu, normal par rapport à ce que je t'ai dit
donc si tu es dans ce cas il faut écrire
if var.a = 1 then
say("toto")
endif
if var.a = 2 then
say("tata")
endif
if var.a > 1 then
wait 2s
say("tutu")
endif
if var.a = 2 then var.a = 0
if u then var.a = 2
la tempo de 2 secondes va permettre que tata soit entendu et pourra enchainer sur tutu
ce n'est pas un probleme en soit mais fo le savoir et comprendre la logique de ce soft assez puissant

En tout cas CA FAIT TRAVAILLER LA LOGIQUE!!!!!!!!!!!!

Glovepie utilise la notion de frame une frame = 1 tour de script, la frequence est donnee par pie.framerate (defaut = 40hz soit 40 fois par sec)
un exmple de script qui te montre l'enchainement des scripts dans la fenetre de debug
t= key.n
debugprint( pie.Frame)
if pressed(t) then
debugprint("yoyo a1" + pie.Frame)
wait 100ms
debugprint("a1")
endif
if pressed(t) then
debugprint("yoyo a2" + pie.Frame)
wait 500ms
debugprint("a2")
endif
lorsque que tu appuies sur la touche n, les 2 boucles sont activées dans la frame 16 mais la tempo affichera le resultat dans 2 frames séparées 20 et 35

0 PieFrames
1 PieFrames
2 PieFrames
3 PieFrames
4 PieFrames
::
14 PieFrames
15 PieFrames
16 PieFrames
yoyo a1 16 PieFrames
yoyo a2 16 PieFrames
17 PieFrames
18 PieFrames
19 PieFrames
20 PieFrames
a1
21 PieFrames
22 PieFrames
23 PieFrames
::
34 PieFrames
35 PieFrames
a2
Frenchy Team Super Hornet
Image
Avatar de l’utilisateur

Topic author
hellfrog
Messages : 5117
Inscription : 22 août 2008

#16

Message par hellfrog »

j'ai enfin compris les frames ! merci Rcaf_frenchy :notworthy
[SIGPIC]http://www.kirikoo.net/images/8WoodMAn- ... 212448.png[/img][/SIGPIC] (\_/) (_'.') ..i72600k@4.5GHz + AsusSabertoothZ77 + 16Go GSkill10700 + AC Noctua + Raptor + Win7x64Ult + WH MFDs SaitekThr 1920x1080x3 dt 1 tactile 6950 2G
(")_(")
[/align]
Avatar de l’utilisateur

Topic author
hellfrog
Messages : 5117
Inscription : 22 août 2008

temporisations

#17

Message par hellfrog »

un des problèmes était le suivant :

script utilisé : press() / wait / release()

test des touches dans KeyTester de Foxy du Cougar

si temporisation avec wait < à 40 ms : il ne voit pas les frappes de touches
si wait = 45 ms ou plus : il répète la frappe plusieurs fois, même si l'appui est très bref.
problème résolu uniquement avec temporisation vers 250 ms -300 ms
pour ne renvoyer qu'une seule frappe non répétée !

[EDIT 06/02] IMPORTANT :
en fait il faut mettre
PIE.framerate = 100
et le delai wait entre press et release à 45 ms pour que ça marche à peu près bien, sinon BS perçoit mal les touches
(pas suffisament testé avant de poster, il était tard...:huh::sweatdrop:innocent::sleep:)
[SIGPIC]http://www.kirikoo.net/images/8WoodMAn- ... 212448.png[/img][/SIGPIC] (\_/) (_'.') ..i72600k@4.5GHz + AsusSabertoothZ77 + 16Go GSkill10700 + AC Noctua + Raptor + Win7x64Ult + WH MFDs SaitekThr 1920x1080x3 dt 1 tactile 6950 2G
(")_(")
[/align]
Avatar de l’utilisateur

Topic author
hellfrog
Messages : 5117
Inscription : 22 août 2008

Script pour tester Framerate et Temporisation

#18

Message par hellfrog »

En réponse au problème du post précédent j'ai fait ce petit script : voir fichier txt joint

//
// test vitesse boucle temporisation / effet touches :
// avec outils foxy du cougar on a dans key tester une visualisation des frappes émulées : u renvoie Shift Control Alt u
//

// Conclusions : bon résultat si Framerate à 100 Hz et delai > 40 ms
//
// ------
// KP+ et KP- pour varier le delai
// PGUP et PGDN pour varier le framerate
// ------
debugprint pie.framerate
key.RightControl+key.RightAlt+key.RightShift+key.U = var.UShifted

if var.Delai = 0 then var.Delai = 40
if pressed(key.NumPadPlus) then
var.Delai = var.delai * 10
end if
if pressed(key.NumPadMinus) then
var.Delai = var.delai / 10
end if

if pressed(key.PageUp) then
PIE.Framerate = PIE.Framerate + 10
end if
if pressed(key.PageDown) then
if pie.framerate>40 then
PIE.Framerate = PIE.Framerate - 10
end if
end if

if pressed(swallow(key.U)) then
press(var.UShifted)
wait var.Delai ms
release(var.UShifted)
end if
Pièces jointes
___tests delais press release.txt
(906 octets) Téléchargé 266 fois
[SIGPIC]http://www.kirikoo.net/images/8WoodMAn- ... 212448.png[/img][/SIGPIC] (\_/) (_'.') ..i72600k@4.5GHz + AsusSabertoothZ77 + 16Go GSkill10700 + AC Noctua + Raptor + Win7x64Ult + WH MFDs SaitekThr 1920x1080x3 dt 1 tactile 6950 2G
(")_(")
[/align]
Avatar de l’utilisateur

666def
Pilote Confirmé
Pilote Confirmé
Messages : 4072
Inscription : 04 février 2005

#19

Message par 666def »

euh pourquoi je comprend rien à ce truc??? :d

Rcaf_Frenchy
Mécano au sol
Mécano au sol
Messages : 523
Inscription : 10 septembre 2002

#20

Message par Rcaf_Frenchy »

Salut Hellfrog je ne suis pas convaincu que ton probleme viennent du framerate a la base,l'objectif est de rendre ta programmation indépendante du temps d'une boucle...Il faut plutot jouer sur la qualité de la touche pressed ou released..
if key.LeftArrow then
toggle(var.PVI800_Mode)
if var.PVI800_Mode then
say("Map Keypad is active")
wait 400 ms
end if
if not var.PVI-800 then
say("Map Keypad is NOT active")
wait 400 ms
end if
end if
remplace par
if press(key.LeftArrow) then
toggle(var.PVI800_Mode)
if var.PVI800_Mode then
say("Map Keypad is active")
else
say("Map Keypad is NOT active")
end if
wait 400ms
end if
taprogrammation sera plus légère et évite les tempos dans un if de second ordre..de plus tu peux eliminer tes tempo de 300ms entre press et release
Frenchy Team Super Hornet
Image

edrom
Nouvelle Recrue
Nouvelle Recrue
Messages : 185
Inscription : 20 décembre 2005

#21

Message par edrom »

Super boulot.
quelqu'un a essayé avec une mastercard (IOCARD) conecter en USB via une iocard expension?
je pense que ca ne peut pas fonctionner car il faut au minimum que le hardware apparaisse en tant que controlleur de jeu dans le panneau de configuration (win XP), ce qui n'est pas le cas du couple (MC/expension)
vous pouvez me confirmer ?
Avatar de l’utilisateur

Topic author
hellfrog
Messages : 5117
Inscription : 22 août 2008

#22

Message par hellfrog »

edrom a écrit :Super boulot.
quelqu'un a essayé avec une mastercard (IOCARD) conecter en USB via une iocard expension?
je pense que ca ne peut pas fonctionner car il faut au minimum que le hardware apparaisse en tant que controlleur de jeu dans le panneau de configuration (win XP), ce qui n'est pas le cas du couple (MC/expension)
vous pouvez me confirmer ?
il sait reconnaitre des claviers supplémentaires,
mais ne différencie pas d'où viennent les entrées entre des claviers différents.
il gère les codes claviers en USB, RAW... je nes ais pas si ça peut suffire
[SIGPIC]http://www.kirikoo.net/images/8WoodMAn- ... 212448.png[/img][/SIGPIC] (\_/) (_'.') ..i72600k@4.5GHz + AsusSabertoothZ77 + 16Go GSkill10700 + AC Noctua + Raptor + Win7x64Ult + WH MFDs SaitekThr 1920x1080x3 dt 1 tactile 6950 2G
(")_(")
[/align]

Rcaf_Frenchy
Mécano au sol
Mécano au sol
Messages : 523
Inscription : 10 septembre 2002

#23

Message par Rcaf_Frenchy »

Une petite question pourquoi passes-tu par une variable intermediaire var.PVI_PushBtn_1... pourquoi ne generes tu pas directement la touche, je pense que cela allegerait ton prog et éviterait des problemes de redondances de touches..

au lieu d'ecrire
key.RightAlt+key.One =var.PVI_PushBtn_1
key.RightAlt+key.Two = var.PVI_PushBtn_2
key.RightAlt+key.Three = var.PVI_PushBtn_3

if var.PVI800_Mode then
//
// Emulation des chiffres
// ----------------------
if Swallow(key.NumPad1) then
press(var.PVI_PushBtn_1)
wait 300 ms
release(var.PVI_PushBtn_1)
end if
if Swallow(key.NumPad2) then
press(var.PVI_PushBtn_2)
wait 300 ms
release(var.PVI_PushBtn_2)
end if
if Swallow(key.NumPad3) then
press(var.PVI_PushBtn_3)
wait 300 ms
release(var.PVI_PushBtn_3)
end if
tu ecris par exemple

if var.PVI800_Mode then
//
// Emulation des chiffres
// ----------------------
key.RightAlt+key.One= Swallow(key.NumPad1)
key.RightAlt+key.Two=Swallow(key.NumPad2)
key.RightAlt+key.Three=Swallow(key.NumPad3)
:
:
end if
Frenchy Team Super Hornet
Image
Avatar de l’utilisateur

Topic author
hellfrog
Messages : 5117
Inscription : 22 août 2008

#24

Message par hellfrog »

- en mettant la liste des touches et leur fonction en début de programme, c'est plus facile pour la maintenance et les corrections en cas d'erreur de touches ou de changement si le soft evolue (patch, version) : il suffit de changer une ligne en début de programme, pas besoin de tout réécrire

- sur un prgramme très complexe de plusierus pages, cela devient fastidieux de recopier à chaque fois les touches, l'utilisation d'une variable est plus simple

- le code est plus lisible (pédagogique) ou compréhensible pour ceux qui ne l'ont pas écrit

- je pensais qu'en ayant une variable, tout changement de la valeur de la variable, donc déclenché par l'appui de la touche, est vu instantanément par le script, donc plus efficace que d'avoir des dizaines de if then avec la même combinaison de touche testée à chaque fois ?

NB : le bout de script pour le PVI800 n'est qu'un "petit" module dans ce que je veux faire : combiner commandes vocales et clavier, avoir des map différents pour le hotas en focntion des étapes du vol etc... et vu le nombre de touches dans BS, le code devient illisile et difficile à debugger en cas d'erreur de saisie.

cela dit
var.bidule = swallow(key.x)

est plus efficace que
if key.x then
presse var.bidule
wait
release var.bidule
endif

NB @ RACF Frenchie : cf http://www.checksix-forums.com/showthread.php?t=149886
[SIGPIC]http://www.kirikoo.net/images/8WoodMAn- ... 212448.png[/img][/SIGPIC] (\_/) (_'.') ..i72600k@4.5GHz + AsusSabertoothZ77 + 16Go GSkill10700 + AC Noctua + Raptor + Win7x64Ult + WH MFDs SaitekThr 1920x1080x3 dt 1 tactile 6950 2G
(")_(")
[/align]

Rcaf_Frenchy
Mécano au sol
Mécano au sol
Messages : 523
Inscription : 10 septembre 2002

#25

Message par Rcaf_Frenchy »

Tout un programme bon courage...
Frenchy Team Super Hornet
Image
Répondre

Revenir à « salle: Periphériques: Hotas, Joysticks, Track-IR »