Previous Thread
Next Thread
Print Thread
Rate This Thread
Hop To
#4209444 - 12/24/15 12:29 AM T.A.R.G.E.T. do....while. syntaxed!  
Joined: Dec 2013
Posts: 46
Space the Blaze Offline
Blazer of Space
Space the Blaze  Offline
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)

Code:
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
}

Inline advert (2nd and 3rd post)

#4209467 - 12/24/15 01:47 AM Re: T.A.R.G.E.T. do....while. syntaxed! [Re: Space the Blaze]  
Joined: Mar 2007
Posts: 483
Aullido Offline
Member
Aullido  Offline
Member

Joined: Mar 2007
Posts: 483
Uonk (and the rest) are pointers to a function, not functions themselves.

Make the following changes (to all)

int Uonk ()
{
EXEC("DXAxis(MOUSE_Y_AXIS,-1);");
}

do
Uonk();
while ( Uo == 1);

#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 Offline
Blazer of Space
Space the Blaze  Offline
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 smile


Code:
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 Offline
Blazer of Space
Space the Blaze  Offline
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. frown

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 Offline
Blazer of Space
Space the Blaze  Offline
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?



Code:
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
}



#4209772 - 12/24/15 09:20 PM Re: T.A.R.G.E.T. do....while. syntaxed! [Re: Space the Blaze]  
Joined: Mar 2007
Posts: 483
Aullido Offline
Member
Aullido  Offline
Member

Joined: Mar 2007
Posts: 483
I don't think you should use DXAxis directly, looks like a support function for other functions mean to be use by the user. Try AXIS that is mentioned at the manual, that function is recommended.

#4209773 - 12/24/15 09:22 PM Re: T.A.R.G.E.T. do....while. syntaxed! [Re: Space the Blaze]  
Joined: Mar 2007
Posts: 483
Aullido Offline
Member
Aullido  Offline
Member

Joined: Mar 2007
Posts: 483
Did you see my post at the other thread?


Moderated by  RacerGT 

Quick Search
Recent Articles
Support SimHQ

If you shop on Amazon use this Amazon link to support SimHQ
.
Social


Recent Topics
The Old Breed and the Costs of War
by wormfood. 04/24/24 01:39 PM
Actors portraying British Prime Ministers
by Tarnsman. 04/24/24 01:11 AM
Roy Cross is 100 Years Old
by F4UDash4. 04/23/24 11:22 AM
Actors portraying US Presidents
by PanzerMeyer. 04/19/24 12:19 PM
Dickey Betts was 80
by Rick_Rawlings. 04/19/24 01:11 AM
Exodus
by RedOneAlpha. 04/18/24 05:46 PM
Grumman Wildcat unique landing gear
by Coot. 04/17/24 03:54 PM
Peter Higgs was 94
by Rick_Rawlings. 04/17/24 12:28 AM
Copyright 1997-2016, SimHQ Inc. All Rights Reserved.

Powered by UBB.threads™ PHP Forum Software 7.6.0