|
|
|
#3437653 - 11/19/11 11:48 PM
8-way POV hat, T.A.R.G.E.T. seems to see only 4 ways
|
Member
Registered: 01/09/11
Posts: 511
Loc: Argentina
|
Hi fellows. I went to buy a USB cable and ended up spending 548 dollars on a joystick... Thank good I´m not married.  And the real problem that I have now is that I don't seem to be able to set my 8-way POV hat. T.A.R.G.E.T. only shows me 4... Any special considerations? What I'm doing is go to the TARGET GUI and choosing New configuration... Thanks in advance.
_________________________
Just like the real Wile E., more problems that solutions lately.
|
|
Top
|
|
|
|
#3517525 - 02/13/12 04:44 AM
Re: 8-way POV hat, T.A.R.G.E.T. seems to see only 4 ways
[Re: WileECoyote]
|
Junior Member
Registered: 02/11/12
Posts: 1
Loc: South Australia
|
Hi WileECoyote Did you ever find an answer on this .. I have a friend with the same issue  Cheers
|
|
Top
|
|
|
|
#3517565 - 02/13/12 07:33 AM
Re: 8-way POV hat, T.A.R.G.E.T. seems to see only 4 ways
[Re: WileECoyote]
|
Member
Registered: 01/09/11
Posts: 511
Loc: Argentina
|
Yeah, our friends at TM added 8-way hats to the thing, but they never thought it would be necessary to actually build a software that worked with them... So you have your hats, but no software to use them. There are workarounds, but they are just that, workarounds. There was a post in these forums... here. I has some info and links to more info about that and many more things. At the end, you'll think "why they just dind't add the freaking support for the 8-way hats?!" The big, big problem of these workarounds is that they seem to work with Hat1 only. If you want to use the coolie, that is supposed to be 8-way too, you have to do something like this, that I put together and never finished polishing. It works, but is ugly as hell: define kCSDR KP9 define kCSDL KP7 define kCSUL KP1 define kCSUR KP3 define kCSD KP8 define kCSU KP2 define kCSL KP4 define kCSR KP6
int fCSU; int fCSD; int fCSL; int fCSR;
int main() { ... fCSU = 0; fCSD = 0; fCSR = 0; fCSL = 0; MapKey(&Throttle, CSU, REXEC(4, 250, "fCSU = 1; if (fCSL == 1) {ActKey(kCSU); ActKey(KEYON+kCSUL);} else if (fCSR == 1) {ActKey(kCSU); ActKey(KEYON+kCSUR);} else ActKey(KEYON+kCSU);", RNOSTOP)); MapKey(&Throttle, CSR, REXEC(5, 250, "fCSR = 1; if (fCSU == 1) {ActKey(kCSR); ActKey(KEYON+kCSUR);} else if (fCSD == 1) {ActKey(kCSR); ActKey(KEYON+kCSDR);} else ActKey(KEYON+kCSR);", RNOSTOP)); MapKey(&Throttle, CSL, REXEC(6, 250, "fCSL = 1; if (fCSU == 1) {ActKey(kCSL); ActKey(KEYON+kCSUL);} else if (fCSD == 1) {ActKey(kCSL); ActKey(KEYON+kCSDL);} else ActKey(KEYON+kCSL);", RNOSTOP)); MapKey(&Throttle, CSD, REXEC(7, 250, "fCSD = 1; if (fCSR == 1) {ActKey(kCSD); ActKey(KEYON+kCSDR);} else if (fCSL == 1) {ActKey(kCSD); ActKey(KEYON+kCSDL);} else ActKey(KEYON+kCSD);", RNOSTOP)); MapKeyR(&Throttle, CSU, EXEC("StopAutoRepeat(4); fCSU = 0; ActKey(kCSU); ActKey(kCSD); ActKey(kCSR); ActKey(kCSL); ActKey(kCSUR); ActKey(kCSUL); ActKey(kCSDL); ActKey(kCSDR);")); MapKeyR(&Throttle, CSR, EXEC("StopAutoRepeat(5); fCSR = 0; ActKey(kCSU); ActKey(kCSD); ActKey(kCSR); ActKey(kCSL); ActKey(kCSUR); ActKey(kCSUL); ActKey(kCSDL); ActKey(kCSDR);")); MapKeyR(&Throttle, CSL, EXEC("StopAutoRepeat(6); fCSL = 0; ActKey(kCSU); ActKey(kCSD); ActKey(kCSR); ActKey(kCSL); ActKey(kCSUR); ActKey(kCSUL); ActKey(kCSDL); ActKey(kCSDR);")); MapKeyR(&Throttle, CSD, EXEC("StopAutoRepeat(7); fCSD = 0; ActKey(kCSU); ActKey(kCSD); ActKey(kCSR); ActKey(kCSL); ActKey(kCSUR); ActKey(kCSUL); ActKey(kCSDL); ActKey(kCSDR);")); ... }
Yep, all that for just a f*cking hat. Hope it helps.
_________________________
Just like the real Wile E., more problems that solutions lately.
|
|
Top
|
|
|
|
#3517650 - 02/13/12 10:04 AM
Re: 8-way POV hat, T.A.R.G.E.T. seems to see only 4 ways
[Re: WileECoyote]
|
Member
Registered: 07/02/05
Posts: 1503
|
There is a somewhat easier way... Note my == statements might look backwards - this is an old programming habit. When you switch between languages and different conventions arise regarding the use of '=', it saves headaches. In C for example, if one accidentally wrote: "if (x=5) print('5');" then it would always evaluate true and '5' would get printed every time that line got executed...and x would equal 5 after that no matter what it was before. However, reversing it (5=x) means it would never evaluate true, 5 would never get printed, and that might help trigger the response that what you really wanted was ==...
include "target.tmh"
//program startup int main() { if(Init(&EventHandle)) return 1; // declare the event handler, return on error
}
//event handler int EventHandle(int type, alias o, int x) {
if (&o == &Joystick & (x==POV)) { if (POVU==Joystick[POV]) ActKey(PULSE+KEYON+'a'); else if (POVUR==Joystick[POV]) ActKey(PULSE+KEYON+'b'); else if (POVR==Joystick[POV]) ActKey(PULSE+KEYON+'c'); else if (POVDR==Joystick[POV]) ActKey(PULSE+KEYON+'d'); else if (POVD==Joystick[POV]) ActKey(PULSE+KEYON+'e'); else if (POVDL==Joystick[POV]) ActKey(PULSE+KEYON+'f'); else if (POVL==Joystick[POV]) ActKey(PULSE+KEYON+'g'); else if (POVUL==Joystick[POV]) ActKey(PULSE+KEYON+'h'); } else if (&o == &Throttle & (x==POV)) { if (POVU==Throttle[POV]) ActKey(PULSE+KEYON+'i'); else if (POVUR==Throttle[POV]) ActKey(PULSE+KEYON+'j'); else if (POVR==Throttle[POV]) ActKey(PULSE+KEYON+'k'); else if (POVDR==Throttle[POV]) ActKey(PULSE+KEYON+'l'); else if (POVD==Throttle[POV]) ActKey(PULSE+KEYON+'m'); else if (POVDL==Throttle[POV]) ActKey(PULSE+KEYON+'n'); else if (POVL==Throttle[POV]) ActKey(PULSE+KEYON+'o'); else if (POVUL==Throttle[POV]) ActKey(PULSE+KEYON+'p'); }
else DefaultMapping(&o, x);
//add event handling code here }
I think I can make an autorepeat version....but I'm a bit busy right now. The above should help, however.
Edited by Teej (02/13/12 10:24 AM)
|
|
Top
|
|
|
|
#3517755 - 02/13/12 11:44 AM
Re: 8-way POV hat, T.A.R.G.E.T. seems to see only 4 ways
[Re: WileECoyote]
|
BS 62 "Pegasus" CAG
Member
Registered: 01/12/11
Posts: 579
|
Hi fellows. I went to buy a USB cable and ended up spending 548 dollars on a joystick... Thank good I´m not married.  Don't be so negative about marriage my wife allows me to buy all the part i need as long as i already know what to do with them and I will actually use it in the cockpit.
_________________________
"When you plan revenge best dig two graves" Confucius "They who can give up essential liberty to obtain a little temporary safety, deserve neither liberty nor safety" Benjamin Franklin
|
|
Top
|
|
|
|
#3518166 - 02/13/12 11:55 PM
Re: 8-way POV hat, T.A.R.G.E.T. seems to see only 4 ways
[Re: WileECoyote]
|
Member
Registered: 07/02/05
Posts: 1503
|
Here's another way to handle autorepeating - nothing wrong with REXEC, but in my eyes at least, this is easier.
include "target.tmh"
//program startup
int lastjoypov;
int main()
{
if(Init(&EventHandle)) return 1; // declare the event handler, return on error
SetShiftButton(&Joystick, S3, &Throttle, BSF, BSB, 0); // I use S3 as shift, and the dogfight/boatswitch as UMD
lastjoypov = '';
}
//event handler
int EventHandle(int type, alias o, int x)
{
if (&o == &Joystick & (x==POV))
{
if (lastjoypov) { // If there was a key pressed, release it.
ActKey(lastjoypov);
lastjoypov='';
}
if (POVU==Joystick[POV]) {ActKey(KEYON+'a'); lastjoypov='a';}
else if (POVUR==Joystick[POV]) {ActKey(KEYON+'b'); lastjoypov='b';}
else if (POVR==Joystick[POV]) {ActKey(KEYON+'c'); lastjoypov='c';}
else if (POVDR==Joystick[POV]) {ActKey(KEYON+'d'); lastjoypov='d';}
else if (POVD==Joystick[POV]) {ActKey(KEYON+'e'); lastjoypov='e';}
else if (POVDL==Joystick[POV]) {ActKey(KEYON+'f'); lastjoypov='f';}
else if (POVL==Joystick[POV]) {ActKey(KEYON+'g'); lastjoypov='g';}
else if (POVUL==Joystick[POV]) {ActKey(KEYON+'h'); lastjoypov='h';}
}
else if (&o == &Throttle & (x==POV))
{
if (POVU==Throttle[POV]) ActKey(PULSE+KEYON+'i');
else if (POVUR==Throttle[POV]) ActKey(PULSE+KEYON+'j');
else if (POVR==Throttle[POV]) ActKey(PULSE+KEYON+'k');
else if (POVDR==Throttle[POV]) ActKey(PULSE+KEYON+'l');
else if (POVD==Throttle[POV]) ActKey(PULSE+KEYON+'m');
else if (POVDL==Throttle[POV]) ActKey(PULSE+KEYON+'n');
else if (POVL==Throttle[POV]) ActKey(PULSE+KEYON+'o');
else if (POVUL==Throttle[POV]) ActKey(PULSE+KEYON+'p');
}
else DefaultMapping(&o, x);
}
Edited by Teej (02/13/12 11:58 PM)
|
|
Top
|
|
|
|
|
|
| |