View Full Version : Repeating keys on USB CH Products?
Ghastly
23-02-2004, 10:01 PM
Hiya Revvin (and anyone else!)
Quick question - I recently replaced my system and at the same time retired my older MSFF2/Suncom Throttle/Simpeds HOTAS mod, in favor of a new all CH USB setup - Fighterstick/Pro Throttle/Pro Pedals.
And... I cannot find a way to make the keys repeat (for use with things like trim), other than by writing a script using timers. Which I've done, and it works, but it just seems so odd that I wanted to ask - did I somehow miss the obvious?
<S>
Ghastly (WWIIOL)
-Ghost (WB's)
Bob Church
23-02-2004, 10:25 PM
Are you actually having problems, or is it just that you're concerned about the characters not showing up? The thing is that the Control Manager's keyboard emulation operates over amongst the HID devices and looks like a USB keyboard as opposed to one of the old AT/PS2 keyboard. USB keyboards don't repeat, they notify the system when the key goes down, and they notifiy it when it goes up, but they don't send anything in between. Windows itself fakes the repeated characters that you'd see in Notepad, for example, and you should see characters from the Control Manager appear to repeat there, too. Most of the newer games and sims should be buying into that scheme okay, though if it's really a function that counts charcters rather than just checking whether the key is still down at the start of each frame, it can get to be a problem.
- Bob
The StickWorks
http://www.stickworks.com
Ghastly
23-02-2004, 10:44 PM
The problem is that all games are not created equal in this regard, and so yes, I was actually having problems.
In 2 of the flight sims that I regularly play, the keys do not behave as though they repeat while in-game with the "simple" mapping of a key to a button, which is problematic when you are setting up trim functions in particular (these sims are Warbirds III, and the current Target Rabaul). I would assume that they would have difficulty then also with a USB keyboard, although I don't use one and haven't tried to so I couldn't say for certain. In fact, in TR, there isn't any repeat even when I use the keyboard (which is PS/2), and I relied on the fact that the Suncom had a repeat function built into it to do what I couldn't even with the keyboard itself.
But in the other game I play (WWIIOL) the key does repeat when you hold down the button, and so it works as you'd expect in game.
I've circumvented the issue for those sims that were problematic via scripting, but thought for sure that I must have missed something in the documentation. I'm a fairly experienced programmer so it was no biggie to figure out how to do so with the CMS scripting, but many people aren't, and so I thought there must be a quick option for this - and I just couldn't find it. It's not like I've not read documentation before and missed the totally obvious (grin).
<S>
Ghastly (-Ghost)
Bob Church
23-02-2004, 11:28 PM
>> The problem is that all games are not created equal in this regard, and so yes, I was actually having problems. <<
Okay. Well, the script is probably all you can do then. Like you said - "all games are not created equal..". I had to do the same thing for the Up/Down programming. It used to be enough just to send repeated makes like the PS2 keyboards, now it has to send "make - break - make - make..." or Windows will complain about "bad firmware". Slows things down quite a bit. You might try adding the HOLD prefix, there are situations where it might make a difference, but I don't think it's probably going to help here.
For anyone else that's having trouble with this, it's not hard to force the repeat in a script. Just set up one timing sequence that looks something like this:
sequence
delay(1);
b1 = not b1
endSequence
The b1 bit will change state once on every character scan and gives you the fastest clock the sim can track. The time is actually set by the Character Rate parameter on the Program Settings tab. Just use it to modulate a CMS button. Say js1.b4 and js1.b5 have to generate breaking repeats. Put the actual characters on cms.b1 and cms.b2 up in the GUI, then use the b1 bit to clock them both like this:
cms.b1 = js1.b4 and b1;
cms.b2 = js1.b5 and b1;
You only need to generate one clock that way rather than setting each one up independently.
- Bob
The StickWorks
http://www.stickworks.com
Revvin
23-02-2004, 11:50 PM
Hey Ghost! glad you found the site hope you found it helpful, you'll find cmc's for the games you mentioned in the cmc forums.
Ghastly
24-02-2004, 01:37 AM
Hi Revvin, thanks! The only problem is... it usually takes me longer to mod anyone elses setup to how I like it to be done than it does to just do it from scratch! {grin}
Thanks Bob, for the way cool hint! That's not how I did it and I can see how your way would be a lot less resource intensive, especiallly if each timer I set is in any way equivilent to a Windows API timer.
I'll convert my 6 or so timers to your mechanism when I get time.
Thanks!
<S>
Ghastly -Ghost
Bob Church
24-02-2004, 07:14 AM
>> Thanks Bob, for the way cool hint! <<
You're quite welcome!
>> That's not how I did it and I can see how your way would be a lot less resource intensive, especiallly if each timer I set is in any way equivilent to a Windows API timer. <<
No, that's not a problem. They're done by the CM and are only limited by the 256 "Dn" device bits that are available. They don't use Windows at all, really. The logic is a little more efficient, though.
- Bob
The StickWorks
http://www.stickworks.com
Revvin
24-02-2004, 11:46 AM
Ghastly> Those cmc files I spoke of are not profiles, they contain the all the commands for a sim and then you simply insert them onto your profile much like the TM two part file system. It makes it quicker and easier to create profiles as you don't have to remember every key command you just select the command from the list that pops up. Check out my second post in this (http://www.ch-hangar.com/forum/index.php?showtopic=159) thread where I explained cmc files to another user. Using the cmc file method also makes it easy to tweek your own profiles.
vBulletin® v3.7.2, Copyright ©2000-2009, Jelsoft Enterprises Ltd.