ArrayArrayArrayArrayArrayArray BrainModular BrainModular Users Forum 2023-10-15T17:14:42+02:00 https://www.brainmodular.com/forums/app.php/feed/topic/7166 2023-10-15T17:14:42+02:00 2023-10-15T17:14:42+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=7166&p=44933#p44933 <![CDATA[Re: saisie valeurs au clavier]]> Testé rapidement sous mac, il semblerait que le module keyb ne fournisse pas d'information de numéro de touche

Statistics: Posted by joffo78 — 15 Oct 2023, 17:14


]]>
2023-10-10T11:57:57+02:00 2023-10-10T11:57:57+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=7166&p=44919#p44919 <![CDATA[Re: saisie valeurs au clavier]]> Merci infiniment je vais étudier tout ça !

Statistics: Posted by joffo78 — 10 Oct 2023, 11:57


]]>
2023-10-09T23:38:55+02:00 2023-10-09T23:38:55+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=7166&p=44918#p44918 <![CDATA[Re: saisie valeurs au clavier]]>
//////////////////////////
//une calculette
//entrer nombre puis appui sur touche +
//appui sur touche enter remet à 0
/////////////////////////
var key, pressed: Tparameter;
var result: Tparameter;
var inval, outval : integer;
//////////////////////////////////////
// Init is started on script compilation to create the in/outs
PROCEDURE INIT;
BEGIN
key:= CreateParam('key',PtDataField,pioInput);
pressed:= CreateParam('pressed',PtDataField,pioInput);
result:= CreateParam('result',PtDataField,pioOutput);
inval := 0;
outval := 0;
END;
//////////////////////////////////////
// Callback procedure
// inputs have an id (n) from first (top) to n last, the callback proc
// scans the inputs to detect changes,
// and notes the index if detecting one.
// that will allows to launchs different process depending on wich kind of
// inputs changed

Procedure Callback(N:integer);
BEGIN
if ((n=1) and (pressed.asInteger = 1) and (key.asInteger > 47) and (key.asInteger < 58))
then begin
inval := (key.asInteger - 48) + 10 * inval;
//result.asInteger(inval);
end;
if ((n=1) and (pressed.asInteger = 1) and (key.asInteger = 43) )//add
then begin
outval := outval + inval;
result.asInteger(outval);
inval := 0;
end;
if ((n=1) and (pressed.asInteger = 1) and (key.asInteger = 13) )//add
then begin
result.asInteger(outval);
inval := 0;
outval := 0;
end;
END;

Statistics: Posted by oli_lab — 09 Oct 2023, 23:38


]]>
2023-10-09T11:39:20+02:00 2023-10-09T11:39:20+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=7166&p=44917#p44917 <![CDATA[Re: saisie valeurs au clavier]]> Statistics: Posted by joffo78 — 09 Oct 2023, 11:39


]]>
2023-10-08T16:37:50+02:00 2023-10-08T16:37:50+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=7166&p=44916#p44916 <![CDATA[Re: saisie valeurs au clavier]]> il faudra définir une syntaxe plus précisément :

pense à une machine à calculer :

il faut que certaines touches délimitent ce qui correspond à l'opérande de ce qui correspond à l'opérateur

par exemple tant que tu tapes des caractères correspondant aux chiffres, ils s'empilent dans un registre (le précédent se multiplie par 10 et s’additionne au chiffre courant)
l'appuie sur + rend le nombre positif, - négatif, et additionne le nombre courant avec le résultat précédent et remet à 0 le registre d'entrée

= fait apparaitre le résultat final

il faudra aussi trier les touches (de 0 à 9, +,-,=....)

un script semble le bon candidat

bon courage

Olivar

Statistics: Posted by oli_lab — 08 Oct 2023, 16:37


]]>
2023-10-05T13:15:08+02:00 2023-10-05T13:15:08+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=7166&p=44911#p44911 <![CDATA[saisie valeurs au clavier]]> J'aimerais savoir si il est possible de créer un script ou un patch ou une procédure
qui permet de saisir des valeurs dans un tableau à partir d'une syntaxe comme
1+23+24
ou 1>24 ( par exemple pour sélectionner 24 valeurs d'un coup)
est il également possible de pouvoir saisir cette valeur directement à partir du module keyb
plutôt que d'avoir à double cliquer sur dans une fenêtre ?
Merci .
JF

Statistics: Posted by joffo78 — 05 Oct 2023, 13:15


]]>
BrainModular BrainModular Users Forum 2023-10-15T17:14:42+02:00 https://www.brainmodular.com/forums/app.php/feed/topic/7166 2023-10-15T17:14:42+02:00 2023-10-15T17:14:42+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=7166&p=44933#p44933 <![CDATA[Re: saisie valeurs au clavier]]> Testé rapidement sous mac, il semblerait que le module keyb ne fournisse pas d'information de numéro de touche

Statistics: Posted by joffo78 — 15 Oct 2023, 17:14


]]>
2023-10-10T11:57:57+02:00 2023-10-10T11:57:57+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=7166&p=44919#p44919 <![CDATA[Re: saisie valeurs au clavier]]> Merci infiniment je vais étudier tout ça !

Statistics: Posted by joffo78 — 10 Oct 2023, 11:57


]]>
2023-10-09T23:38:55+02:00 2023-10-09T23:38:55+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=7166&p=44918#p44918 <![CDATA[Re: saisie valeurs au clavier]]>
//////////////////////////
//une calculette
//entrer nombre puis appui sur touche +
//appui sur touche enter remet à 0
/////////////////////////
var key, pressed: Tparameter;
var result: Tparameter;
var inval, outval : integer;
//////////////////////////////////////
// Init is started on script compilation to create the in/outs
PROCEDURE INIT;
BEGIN
key:= CreateParam('key',PtDataField,pioInput);
pressed:= CreateParam('pressed',PtDataField,pioInput);
result:= CreateParam('result',PtDataField,pioOutput);
inval := 0;
outval := 0;
END;
//////////////////////////////////////
// Callback procedure
// inputs have an id (n) from first (top) to n last, the callback proc
// scans the inputs to detect changes,
// and notes the index if detecting one.
// that will allows to launchs different process depending on wich kind of
// inputs changed

Procedure Callback(N:integer);
BEGIN
if ((n=1) and (pressed.asInteger = 1) and (key.asInteger > 47) and (key.asInteger < 58))
then begin
inval := (key.asInteger - 48) + 10 * inval;
//result.asInteger(inval);
end;
if ((n=1) and (pressed.asInteger = 1) and (key.asInteger = 43) )//add
then begin
outval := outval + inval;
result.asInteger(outval);
inval := 0;
end;
if ((n=1) and (pressed.asInteger = 1) and (key.asInteger = 13) )//add
then begin
result.asInteger(outval);
inval := 0;
outval := 0;
end;
END;

Statistics: Posted by oli_lab — 09 Oct 2023, 23:38


]]>
2023-10-09T11:39:20+02:00 2023-10-09T11:39:20+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=7166&p=44917#p44917 <![CDATA[Re: saisie valeurs au clavier]]> Statistics: Posted by joffo78 — 09 Oct 2023, 11:39


]]>
2023-10-08T16:37:50+02:00 2023-10-08T16:37:50+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=7166&p=44916#p44916 <![CDATA[Re: saisie valeurs au clavier]]> il faudra définir une syntaxe plus précisément :

pense à une machine à calculer :

il faut que certaines touches délimitent ce qui correspond à l'opérande de ce qui correspond à l'opérateur

par exemple tant que tu tapes des caractères correspondant aux chiffres, ils s'empilent dans un registre (le précédent se multiplie par 10 et s’additionne au chiffre courant)
l'appuie sur + rend le nombre positif, - négatif, et additionne le nombre courant avec le résultat précédent et remet à 0 le registre d'entrée

= fait apparaitre le résultat final

il faudra aussi trier les touches (de 0 à 9, +,-,=....)

un script semble le bon candidat

bon courage

Olivar

Statistics: Posted by oli_lab — 08 Oct 2023, 16:37


]]>
2023-10-05T13:15:08+02:00 2023-10-05T13:15:08+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=7166&p=44911#p44911 <![CDATA[saisie valeurs au clavier]]> J'aimerais savoir si il est possible de créer un script ou un patch ou une procédure
qui permet de saisir des valeurs dans un tableau à partir d'une syntaxe comme
1+23+24
ou 1>24 ( par exemple pour sélectionner 24 valeurs d'un coup)
est il également possible de pouvoir saisir cette valeur directement à partir du module keyb
plutôt que d'avoir à double cliquer sur dans une fenêtre ?
Merci .
JF

Statistics: Posted by joffo78 — 05 Oct 2023, 13:15


]]>