#4209444 - 12/24/15 12:29 AM
T.A.R.G.E.T. do....while. syntaxed!
|
Joined: Dec 2013
Posts: 46
Space the Blaze
Blazer of Space
|
Blazer of Space
Junior Member
Joined: Dec 2013
Posts: 46
|
Compile Error: = expected in workingmousecode.tmc at line 81 (see // comment to see the line) Why? And what is the fix? (me such a noob, lol)
include "target.tmh"
//mouse test file
//target.tmh file you need to patch ... line 193 PlugMouse(0);
//target.tmh file you need to patch ... line 258 else if (&dev == &T16000 | &dev == &T16001)
alias T16001; // second T16000 handle, which will be used all mapping commands
alias T16A; // for handy switching purposes only
alias T16B; // same here
define switchthem 1 // make 0/1 if left=right
int Uonk;
int Donk;
int Lonk;
int Ronk;
int Stopper;
char Uo;
char Do;
char Lo;
char Ro;
int main()
{
Uo=0;
Lo=0;
Do=0;
Ro=0;
Stopper = EXEC("DXAxis(MOUSE_X_AXIS, 0);" "DXAxis(MOUSE_Y_AXIS, 0);");
Uonk = EXEC("DXAxis(MOUSE_Y_AXIS,-1);");
Donk = EXEC("DXAxis(MOUSE_Y_AXIS,+1);");
Lonk = EXEC("DXAxis(MOUSE_X_AXIS,-1);");
Ronk = EXEC("DXAxis(MOUSE_X_AXIS,+1);");
Configure(&HCougar, MODE_EXCLUDED);
Configure(&Joystick, MODE_EXCLUDED);
Configure(&Throttle, MODE_EXCLUDED);
Configure(&LMFD, MODE_EXCLUDED);
Configure(&RMFD, MODE_EXCLUDED);
if(Init(&EventHandle)) return 1; // declare the event handler, return on error
&T16001 = GetIndexJoy (SelectUsbDevice ("VID_044F&PID_B10A")); //pc expects a joystick on this adress
if (switchthem)
{
&T16A = &T16000;
&T16B = &T16001;
&T16000 = &T16B;
&T16001 = &T16A;
}
// this was about making the left one right and vice...
MapKey (&T16000, TS3, Stopper);
MapKey(&T16001, H1U, "Uo=1;");
MapKey(&T16001, H1D, "Do=1;");
MapKey(&T16001, H1L, "Lo=1;");
MapKey(&T16001, H1R, "Ro=1;");
MapKeyR(&T16001, H1U, "Uo=0;");
MapKeyR(&T16001, H1D, "Do=0;");
MapKeyR(&T16001, H1L, "Lo=0;");
MapKeyR(&T16001, H1R, "Ro=0;");
do Uonk while (Uo=1); //line 81
do Donk while (Do=1);
do Ronk while (Ro=1);
do Lonk while (Lo=1);
}
//event handler
int EventHandle(int type, alias o, int x)
{
DefaultMapping(&o, x);
//add event handling code here
}
|
|
#4209542 - 12/24/15 06:35 AM
Re: T.A.R.G.E.T. do....while. syntaxed!
[Re: Space the Blaze]
|
Joined: Dec 2013
Posts: 46
Space the Blaze
Blazer of Space
|
Blazer of Space
Junior Member
Joined: Dec 2013
Posts: 46
|
Ok, I will see if that solves my puzzle. In the meantime I have another. The below code gives me a mouse that not let's star citizen sim (the game) freak out. But SET(1) gives me huge hops. How do I get '1' smaller? /10 gives me errors. And my math is so bad you don't even want to know
include "target.tmh"
//mouse test file
//target.tmh file you need to patch ... line 193 PlugMouse(0);
//target.tmh file you need to patch ... line 258 else if (&dev == &T16000 | &dev == &T16001)
alias T16001; // second T16000 handle, which will be used all mapping commands
alias T16A; // for handy switching purposes only
alias T16B; // same here
define switchthem 1 // make 0/1 if left=right
int Stopper;
int main()
{
Stopper = EXEC("DXAxis(MOUSE_X_AXIS, 0);" "DXAxis(MOUSE_Y_AXIS, 0);");
Configure(&HCougar, MODE_EXCLUDED);
Configure(&Joystick, MODE_EXCLUDED);
Configure(&Throttle, MODE_EXCLUDED);
Configure(&LMFD, MODE_EXCLUDED);
Configure(&RMFD, MODE_EXCLUDED);
if(Init(&EventHandle)) return 1; // declare the event handler, return on error
&T16001 = GetIndexJoy (SelectUsbDevice ("VID_044F&PID_B10A")); //pc expects a joystick on this adress
if (switchthem)
{
&T16A = &T16000;
&T16B = &T16001;
&T16000 = &T16B;
&T16001 = &T16A;
}
// this was about making the left one right and vice...
MapKey (&T16001, TS3, Stopper);
MapKey(&T16000, H1L, REXEC(0, 88, "TrimDXAxis(MOUSE_X_AXIS, SET(-1));"));
MapKey(&T16000, H1R, REXEC(0, 88, "TrimDXAxis(MOUSE_X_AXIS, SET(1));"));
MapKey(&T16000, H1U, REXEC(0, 88, "TrimDXAxis(MOUSE_Y_AXIS, SET(-1));"));
MapKey(&T16000, H1D, REXEC(0, 88, "TrimDXAxis(MOUSE_Y_AXIS, SET(1));"));
}
//event handler
int EventHandle(int type, alias o, int x)
{
DefaultMapping(&o, x);
//add event handling code here
}
|
|
#4209544 - 12/24/15 06:38 AM
Re: T.A.R.G.E.T. do....while. syntaxed!
[Re: Space the Blaze]
|
Joined: Dec 2013
Posts: 46
Space the Blaze
Blazer of Space
|
Blazer of Space
Junior Member
Joined: Dec 2013
Posts: 46
|
I think I need to get mouse coordinates before I can use math at it, but I really have no clue. The '1' gives me hops of about 10cm. And I tried to get it smaller then one, but I am lost in the woods. No idea how to get the mouse coordinates or even how to apply math to it.
|
|
#4209770 - 12/24/15 09:14 PM
Re: T.A.R.G.E.T. do....while. syntaxed!
[Re: Space the Blaze]
|
Joined: Dec 2013
Posts: 46
Space the Blaze
Blazer of Space
|
Blazer of Space
Junior Member
Joined: Dec 2013
Posts: 46
|
This code also does not give me the wanted result. It seems int Uonk () { EXEC("DXAxis(MOUSE_Y_AXIS,-10);"); }; does not automatically adds 10 pixels to the DXAxis of the MOUSE AXIS. I guess only knowing core C language and a high degree in math will be required to dive into target.tmh and get the DXAXIS of the MOUSE it makes and adding values (pixelhops) to it. And my guess is that a line 193 PlugMouse(0) or line 193 PlugMouse(1) gives total different formula's of how the mouse works?
include "target.tmh"
//mouse test file
alias T16001; // second T16000 handle, which will be used all mapping commands
alias T16A; // for handy switching purposes only
alias T16B; // same here
define switchthem 1 // make 0/1 if left=right
//int Uonk;
//int Donk;
//int Lonk;
//int Ronk;
int Uonk ()
{
EXEC("DXAxis(MOUSE_Y_AXIS,-10);");
};
int Donk ()
{
EXEC("DXAxis(MOUSE_Y_AXIS,10);");
}
int Lonk ()
{
EXEC("DXAxis(MOUSE_X_AXIS,-10);");
}
int Ronk ()
{
EXEC("DXAxis(MOUSE_X_AXIS,10);");
}
//int Stopper () {EXEC("DXAxis(MOUSE_X_AXIS, 0);" "DXAxis(MOUSE_Y_AXIS, 0);");}
char Uo;
char Do;
char Lo;
char Ro;
int main()
{
Uo=0;
Lo=0;
Do=0;
Ro=0;
//Uonk = EXEC("DXAxis(MOUSE_Y_AXIS,-1);");
//Donk = EXEC("DXAxis(MOUSE_Y_AXIS,+1);");
//Lonk = EXEC("DXAxis(MOUSE_X_AXIS,-1);");
//Ronk = EXEC("DXAxis(MOUSE_X_AXIS,+1);");
Configure(&HCougar, MODE_EXCLUDED);
Configure(&Joystick, MODE_EXCLUDED);
Configure(&Throttle, MODE_EXCLUDED);
Configure(&LMFD, MODE_EXCLUDED);
Configure(&RMFD, MODE_EXCLUDED);
if(Init(&EventHandle)) return 1; // declare the event handler, return on error
&T16001 = GetIndexJoy (SelectUsbDevice ("VID_044F&PID_B10A")); //pc expects a joystick on this adress
if (switchthem)
{
&T16A = &T16000;
&T16B = &T16001;
&T16000 = &T16B;
&T16001 = &T16A;
}
// this was about making the left one right and vice...
//MapKey (&T16000, TS3, Stopper);
MapKey(&T16001, H1U, "Uo=1;");
MapKey(&T16001, H1D, "Do=1;");
MapKey(&T16001, H1L, "Lo=1;");
MapKey(&T16001, H1R, "Ro=1;");
MapKeyR(&T16001, H1U, "Uo=0;");
MapKeyR(&T16001, H1D, "Do=0;");
MapKeyR(&T16001, H1L, "Lo=0;");
MapKeyR(&T16001, H1R, "Ro=0;");
//do Uonk while (Uo=1);
//do Donk while (Do=1);
//do Ronk while (Ro=1);
//do Lonk while (Lo=1);
do
Uonk();
while ( Uo == 1);
do
Donk();
while ( Do == 1);
do
Lonk();
while ( Lo == 1);
do
Ronk();
while ( Ro == 1);
}
//event handler
int EventHandle(int type, alias o, int x)
{
DefaultMapping(&o, x);
//add event handling code here
}
|
|
|
|
|
|
|
|
|
|
Exodus
by RedOneAlpha. 04/18/24 05:46 PM
|
|
|
|