Previous Thread
Next Thread
Print Thread
Rate This Thread
Hop To
#4012519 - 09/21/14 11:39 AM mouse cursor...linking virtual one to physical one in T.A.R.G.E.T.  
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
Hello,

I use a T16000M (actually two...but that's not important right now)

I want to use this code:

//let's tell TARGET we want a mouse on our HAT
int fastmousecursor;
int slowmousecursor;


int main()
{
some stuff...
SetShiftButton (&T16000, TS2, 0, 0, 0 ,0 ); // Left TS2= IO toggle...(why all the zero's?)

//lets get ourselves our moving mousecursor on our left stick (T16000)....and at two speeds (H1D of the right stick (T16001) to go fast)
fastmousecursor=
MapKey (&T16000, H1U, AXIS(MOUSE_Y_AXIS, -100, 5));
MapKey (&T16000, H1D, AXIS(MOUSE_Y_AXIS, 100, 5));
MapKey (&T16000, H1L, AXIS(MOUSE_X_AXIS, -100, 5));
MapKey (&T16000, H1R, AXIS(MOUSE_X_AXIS, 100, 5));

slowmousecursor=
MapKey (&T16000, H1U, AXIS(MOUSE_Y_AXIS, -100, 32));
MapKey (&T16000, H1D, AXIS(MOUSE_Y_AXIS, 100, 32));
MapKey (&T16000, H1L, AXIS(MOUSE_X_AXIS, -100, 32));
MapKey (&T16000, H1R, AXIS(MOUSE_X_AXIS, 100, 32));
//hmmm....this one can just be programmed without the 'slowmousecursor=' part, right? Why would I need that, lol..
//5 and 32...the higher...the greater the time interval. and 100 is how many pixels it skips

MapKeyIO (&T16001, H1D, 'z', EXEC("fastmousecursor") );
// launch flare (z in Star Citizen) in layer, or out of layer have a button that let's me have a faster mouse corsor on the other stick POV HAT.
Does this kill the 'slowmousecursor' if I just programmed that plain without any EXEC of stuff like that?


My real problem is.... TARGET seems to let me have 2 mouse cursors!
I can move the mouse cursor with my mouse....but when I move it with my HAT, the cursor get's reset to the middle of the screen, and from there on
-when I use the physical mouse it moves on from where I leave from either the mouse itself or the HAT, but
-when I use the hat's mouse cursor moving abilities, it get's reset from where the HAT mouse coordinates left last.
really weird..
The physical mouse seems to use both it's own and the TARGET's coordinates, where TARGET only seem to know it's own.

I want to link the coordinates of both the visual mouse and physical mouse. Link their indexes or let them peek at eachothers.

They should share their coordinates. Now it is only done half.
I have no idea how to program it so they 100% share their cursor..
It might even fix the issue so SC doesn't crash when I use mouse code. (the cursor get's locked out of screen the second I touch the HAT, and the starship starts flippin violantly as it tries to follow the cursor)

Last edited by SpaceBlaze; 09/21/14 11:49 AM.
Inline advert (2nd and 3rd post)

#4012554 - 09/21/14 12:47 PM Re: mouse cursor...linking virtual one to physical one in T.A.R.G.E.T. [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
Hmmm... C programmers might need more code to figure out how TARGET works. Here is the TARGET codes (just open with notepad or your own code reader/doer):

http://www.speedyshare.com/QkM6p/target.tmh

http://www.speedyshare.com/uNEPF/sys.tmh

http://www.speedyshare.com/zndtq/hid.tmh

http://www.speedyshare.com/xvVN8/defines.tmh

And my own file looks like this (still needs a lot of change, cause it's an old file, but it shows more code)

http://www.speedyshare.com/5DKNc/Solbeamer-22.3a-all-new.tmc


To be clear...in this last file all the stuff of linking it must be. That's the only file I can tinker with.
The other files are part of software.

Last edited by SpaceBlaze; 09/21/14 12:56 PM.
#4012640 - 09/21/14 06:01 PM Re: mouse cursor...linking virtual one to physical one in T.A.R.G.E.T. [Re: Space the Blaze]  
Joined: Jul 2009
Posts: 9,620
CyBerkut Offline
Administrator
CyBerkut  Offline
Administrator
Hotshot

Joined: Jul 2009
Posts: 9,620
Florida
I'm not up on TARGET scripting, but the described problem sounds like the hat is doing absolute instead of relative input. I would think that if you want the hat to move the cursor from whatever position the mouse left it at, you would need to have the hat outputting in a relative fashion, rather than absolute.

Something to investigate, perhaps.

#4015521 - 09/28/14 02:34 PM Re: mouse cursor...linking virtual one to physical one in T.A.R.G.E.T. [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
added this...

MapAxis(&T16000, H1U, MOUSE_Y_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
MapAxis(&T16000, H1D, MOUSE_Y_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
MapAxis(&T16000, H1L, MOUSE_X_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
MapAxis(&T16000, H1R, MOUSE_X_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);

OR

MapAxis(&T16000, H1U, MOUSE_Y_AXIS, AXIS_NORMAL, MAP_RELATIVE);
MapAxis(&T16000, H1D, MOUSE_Y_AXIS, AXIS_NORMAL, MAP_RELATIVE);
MapAxis(&T16000, H1L, MOUSE_X_AXIS, AXIS_NORMAL, MAP_RELATIVE);
MapAxis(&T16000, H1R, MOUSE_X_AXIS, AXIS_NORMAL, MAP_RELATIVE);


alas...in both cases still two starting positions...


Moderated by  RacerGT 

Quick Search
Recent Articles
Support SimHQ

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


Recent Topics
Carnival Cruise Ship Fire....... Again
by F4UDash4. 03/26/24 05:58 PM
Baltimore Bridge Collapse
by F4UDash4. 03/26/24 05:51 PM
The Oldest WWII Veterans
by F4UDash4. 03/24/24 09:21 PM
They got fired after this.
by Wigean. 03/20/24 08:19 PM
Grown ups joke time
by NoFlyBoy. 03/18/24 10:34 PM
Anyone Heard from Nimits?
by F4UDash4. 03/18/24 10:01 PM
RIP Gemini/Apollo astronaut Tom Stafford
by semmern. 03/18/24 02:14 PM
10 years after 3/8/2014
by NoFlyBoy. 03/17/24 10:25 AM
Copyright 1997-2016, SimHQ Inc. All Rights Reserved.

Powered by UBB.threads™ PHP Forum Software 7.6.0