Previous Thread
Next Thread
Print Thread
Rate This Thread
Hop To
#4082351 - 02/22/15 11:02 PM Help with repeating twice the same character.  
Joined: Mar 2007
Posts: 483
Aullido Offline
Member
Aullido  Offline
Member

Joined: Mar 2007
Posts: 483
Take a look at this code:

byte xFlaps = 0;
int DoNothing;

//----------------------------------------------------------------------------------------------------------------------------------- LandingMode

int
Workaround ()
{
ActKey(PULSE+KEYON+FlapsDown);
}

int
FlapsControl ()
{
if (xFlaps == 0)
{

//ActKey(PULSE+KEYON+FlapsDown);
//ActKey(PULSE+KEYON+FlapsDown); // Desired behavior: v v. Only sends One v.

//ActKey(PULSE+KEYON+FlapsDown);
//ActKey(PULSE+KEYON+'w'); // Any other key works, sendind v null v doesn't either.

//DOWN+ UP+ doesn't work.

//Workaround();

//DoNothing = 0;

//while (DoNothing <= 50000)
// {
// DoNothing = DoNothing + 1;
// }

//Workaround();
}

if (xFlaps == 3)
{
ActKey(PULSE+KEYON+FlapsUp);
}

xFlaps = 2;
}

int
LandingMode ()
{

MapKey
(
&Throttle,
BSF,
0
);

MapKeyR
(
&Throttle,
BSF,
0
);

MapKeyIO
(
&Throttle,
FLAPU,
0,
CHAIN
(
PULSE+FlapsUp,
D(),
PULSE+FlapsUp,
EXEC
(
"xFlaps = 0;"
)
)
);

MapKeyIO
(
&Throttle,
FLAPM,
0,
EXEC
(
"FlapsControl();"
)
);

MapKeyIO
(
&Throttle,
FLAPD,
0,
CHAIN
(
PULSE+FlapsDown,
EXEC
(
"xFlaps = 3;"
)
)
);
}

The event tester shows only a v is pressed. Looks like consecutive ActKeys are first pressed, then released. I tried to separate both actkeys but I ran out of ideas.

Any help will be truly appreciated. thanks.

Inline advert (2nd and 3rd post)

#4085256 - 02/28/15 01:42 AM Re: Help with repeating twice the same character. [Re: Aullido]  
Joined: Mar 2007
Posts: 483
Aullido Offline
Member
Aullido  Offline
Member

Joined: Mar 2007
Posts: 483
DeferCall does the trick:

DeferCall(100,&ActKey,PULSE+KEYON+FlapsDown);


Moderated by  RacerGT 

Quick Search
Recent Articles
Support SimHQ

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


Recent Topics
How Many WW2 Veterans Still Alive 2024?
by F4UDash4. 04/26/24 02:45 AM
Headphones
by RossUK. 04/24/24 03:48 PM
Skymaster down.
by Mr_Blastman. 04/24/24 03:28 PM
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
Copyright 1997-2016, SimHQ Inc. All Rights Reserved.

Powered by UBB.threads™ PHP Forum Software 7.6.0