PDA

View Full Version : Hold Button at last



verana_ss
8th August 2008, 12:44 PM
Hi Im Verana:salute:

this is my first post in this forum :)
Im having problem with making CMC.
Please give me your advice.

this is my cmc.

//
JDAM-Release-press ALT SHF 2 ALT SHF KP6 HOLD SPC
//

it can be loaded from CM Control manager.
but actually, "HOLD SPC" doesn't work for me.
it act like NULL.
I mean, Spacebar is pushed only once. it wont let me hold Spacebar.

Thanks in advance:idea:

Bob Church
9th August 2008, 01:58 AM
>> this is my first post in this forum <<

Welcome to the forumj!

>> Im having problem with making CMC. Please give me your advice. <<

The HOLD key is kind of misunderstood. It doesn't hold a particular key down, it's meant for use when you need to press more than one key at the same time. What you're trying to do probably best down with a "KEYS" macro. For the press side, program it like this:


keys +LSHF chardly +2 chardly -2 chardly -LSHF chardly +LALT chardly +LSHF chardly +KP6 chardly -KP6 chardly -LSHF chardly -LALT chardly +SPC

For the release side, the easiest thing is to just program it to send a SPC. It's alreay pressed so the only thing that will have any effect:


SPC

Give that a try, note that there are no spaces between the "+" and the "LALT" for example. If you try to space them, it won't compile. I put "chardly"s everywhere. Not all of them are probably necessary, it depends on how the sim handles things. You can try taking them out on at a time if you want, but they shouldn't cause any problems except it gets a little slower. Anyway that sends "SHF 2 ALT SHF KP6" and then hold SPC down until you realease the button, which I think is what you're looking for. Also, if you really want to use a CMC file you'll need to make a separate one for the press and for the release side. It's probably easier just to type it right into the Press and Release field. You could also script it and use seperate buttons, but this is probably as easy as anything.

Hope this helps!

Best regards,

- Bob

The StickWorks
http://www.stickworks.com

verana_ss
12th August 2008, 05:52 AM
Hi, Mr. Bob Church!:salute:

Thankyou very much!:thumbsup:
I appreciate to your kindness advice:salute:
it worked prefectly!:thumbsup:

thankyou so much!

Verana

Bob Church
12th August 2008, 03:31 PM
Hi Verana,

You're quite welcome, Verana! I'm glad it worked for you!

Best regards,

- Bob

The StickWorks
http://www.stickworks.com

PureEvil
29th October 2008, 04:33 PM
hello everyone! is there any limitations on how long the string can be in "list mode"?

keys +RSHF chardly +o chardly -o chardly -RSHF chardly +q chardly -q chardly +n chardly -n chardly +LALT chardly +t chardly -t chardly -LALT chardly +y chardly -y chardly +o chardly -o chardly +LALT chardly +w chardly -w chardly -LALT
the above works fine, the only problem is that when i release the botton, it runs the string again, and i don't want that to happen. any ideas on how to fix that? i can't fly all the time with the pushed botton:rofl:
and yes, your forum was very useful for me, starting to use some scripts too :yahoo:

Bob Church
30th October 2008, 03:22 AM
Hi PureEvil,

I went back and looked at the code, and there is no hard limit. Rather, there's a "string area" associated with the instruction and the strings are all put there and then referenced by pointers.

It does repeat as you said, though, and the length certainly has something to do with it. Maybe you've run into the end of the string buffer, I'll have to dig into it when I get a chance.

It won't fix it, but it may help. You don't need all those CHARDLYs. In general, you only need a CHARDLY when you have to "-" charaters or two "+" characters in a row, e.g. "+RSHF +c" would need the CHARDLY but "-c +RSHF" wouldn't. The problem that requires the CHARDLY occurs because the CM sends all the make it can, then all the breaks it can. That would result in the "RSHF c" getting sent in the same data packet and a lot of the sims won't recognize the shift when they come at the same instant. If you're doing "+o -o" the CM puts a CHARDLY in anyway. I tried your and it would work with only 3 of the CHARDLYs I think, that shortened it a lot but not quite enough. If I took the last "LALT" group off the end.

Anyway, there is apparently some maximum, whether it's the size of the individual macro or the total size I can't really tell. When I get some time to dig into I'll see if I can sort out what the cause is. Whether it can be fixed or not another question.

Anyway, FWIW, it's a problem with the program, not your script. You might be able to cut it up into smaller chunks and then use a sequence to generate it. You'd need to use CMS, but it's easy enough to set up. I can show you how to do it if you need help.

Anyway, sorry for the trouble. It's apparently been that way since day one, I guess nobody ever tried to get it out that far before.

Best regards,

- Bob

The StickWorks
http://www.stickworks.com

PureEvil
30th October 2008, 06:18 PM
i did it :)

keys +RSHF +o -o -RSHF +y -y +o -o +n -n +q -q +LALT +t -t -LALT +LALT +w -w -LALT
nothing to "Press", all goes to "Release".

Bob Church
30th October 2008, 06:35 PM
Hi PureEvil,

Well, I'd never have thought that would matter but then with Windows who knows. I'll have to take a look when I get it opened up again.

Thanks for the feedback!

Best regards,

- Bob

The StickWorks
http://www.stickworks.com

Chris0381
30th October 2008, 09:56 PM
Would you guys mind if I ask what the "+" and "Keys" command does.

Thanks

Bob Church
30th October 2008, 10:33 PM
Hi Chris,

Sure. It's a method for controlling the order in which the keys get pressed and released. The macro alway starts with the keyword "KEYS". After the, if you program "+a" for example, the "a" key gets pressed but not released. To get it to release, you have to program "-a". There are several places where the actual ordering of the presses and releases matters, and the HID keyboard can send 6 keys at one time so there's no delay between "SHF" and "a" for example. They come up in the same data packet and some sims won't accept that. The look for one key per frame, once they find one they stop looking. It lets you control the ordering explicitly except in the aforementioned case where the CHARDLY is needed to guarantee the timing.

The thing is, the sim is looking for single keystrokes in order, like you would type them from the keyboard. They were never set up to deal with multiple characters in a single frame. the KEYS macro gives you a workaround.

It's covered in the Users Manual, or you can look here:

http://home.att.net/~stickworks/programchars.htm

for the same information. It's down at the bottom of the page.

Hope this helps!

Best regards,

- Bob