Tom Kazansky Posted November 18, 2019 Posted November 18, 2019 hi, I'm quite new to this part of the forum, but I need help. I got a 2nd keyboard, which is more or less a button box (Active Key AK-S100D-UW-B112). It does an outstanding job but it was not intended to be used as a 2nd keyboard for PC-games. So I got this issue: Everything is fine as long as I use unmodified keys (like "a", "b", "1", "2", ...) When I use a CTRL or/and a ALT modifier (e.g. "CTRL+X") the problems start : in the FA-18C: I can use CTRL+X binding for all of the MFD-OSB's (with a little problem, that most of the time the animation of a pressed button does not show) but I can't use CTRL+X for the UFC buttons like A/P or IFF or... if I do, and hold (which means repeat) the key for IFF then a while it does nothing, sometimes it shows the press-animation on the UFC but does not go to IFF page, sometimes it shows the animation and goes to IFF page. I noticed that the animation is very, no: extremely short so I suspect there is a timing problem with the duration of the keypress of this keyboard. in the Viper: it is like the other way around. I can't use my keybord with CTRL+X for the MFD-OSB's without that problem. but I can use CTRL+X for the ICP (UFC) buttons without any problems, (but not for the data control switch [up, dwn, RTN, SEQ]. In fact this switch has the worst timing problem for my inputs.) with both modules I noticed, that to add my CTRL+X in the Options-Controls-Key-Binding-Menu I have to press and hold the key quite a few seconds till all of the desired keys like "CTRL", "ALT", "Shift" and "X" appear successively. Once they are there, I can use this new bound key to find the "bound action" in this menu by just one single press without problem. So the timing in the key-binding-menu is different from the timing you need to find the action for the pressed key. So my questions to the DEVs are: 1.) Are you aware that the needed key press input timming is different between MFD-OSB key inputs and UFC-key-inputs? 2.) If "yes": is that on purpose? Does it need to be different for some reason? 3.) If "no": can you please change the input behavior of the Viper's MFD-OSBs and the Hornet's UFC to the same values that Viper's ICP (e.g. AA or AG or LIST button) and the Hornet MFD-OSBs have? Are there any home cockpit builders who have their own keys and switches done with similar problems? I can't handle the input timing of my 2nd keyboard by software nor hardware so I'm in your hands, dear devs. :helpsmilie: Many thanks for reading this and may be for offering some help?
rob10 Posted November 18, 2019 Posted November 18, 2019 Unfortunately I can't help, but I can tell you you're not imagining things. I use 2 Enterpads (same basic idea as your keyboard) and there are some things that just don't work well with a press. Specifically the UFC IFF/TCN/ILS/DL buttons and a couple of others I can't remember at the moment. Fortunately in my case it's running off Autohotkey (AHK) so I was able to set it to hold the key just a little longer and it works most of the time (still occasionally get animation of a press with no activation on some keys). One other comment: I think it's more a need for a LONGER PRESS that makes it not work, so if it's just REPEATING it's, well, repeating :) a too short press that the sim isn't picking up most of the time (until it finally manages to catch one and activates sometimes). I'd love to see this looked at too. I can understand some things requiring a long press (or press and hold) (i.e. TGP FLIR/TV toggle), but most shouldn't need.
Tom Kazansky Posted November 19, 2019 Author Posted November 19, 2019 (edited) Thanks a lot for your post. Good to hear I'm not the only one that sees this issue. I agree completely with all you've said. Unfortunately I can't change the duration of a standard key press (means every key that's not a modifier) of my buttonbox keyboard. There is no hold function where you can dedicate the key that should be held. So I use the repeat option bc it sometimes work. I tried also to map unmodified keys to the buttons that show the timing problems. Worked well for some buttons in the Hornet but since the Viper' s 20 OSBs around the MFDs show the issue there is no way to use simple keys. For me there a 2 options: ED looks at this timing issue and change all buttons to the behaviour of the Hornet OSBs. or Get the company that creates my keyboard to change their software. Latter is quite unrealistic so my hopes lie at ED :helpsmilie: Edited November 19, 2019 by Tom Kazansky
AnarchyZG Posted November 19, 2019 Posted November 19, 2019 I ran into the similar if not the same issue while developing MATRIC, and came to the conclusion that DCS will not respond to "key down" event, but I have to emulate "button auto repeat" like most keyboard drivers do. During testing I realized i need to make a few milliseconds pause between keyboard press/release events for DCS to work... [sIGPIC][/sIGPIC] MATRIC developer Check out MATRIC and forget about keyboard shortcuts
Tom Kazansky Posted November 19, 2019 Author Posted November 19, 2019 I ran into the similar if not the same issue while developing MATRIC, and came to the conclusion that DCS will not respond to "key down" event, but I have to emulate "button auto repeat" like most keyboard drivers do. During testing I realized i need to make a few milliseconds pause between keyboard press/release events for DCS to work... Thanks. This confirms my thoughts. Some buttons in DCS cockpits require a keypress that is some milliseconds longer than my buttonbox offers. I wish I could modify the timing of my buttonbox. But I can only work with press and release for modifier keys. (SHIFT, ALT, CTRL). The letters and number keys have no press/release functionality. It is odd that a unmodified key of my box work with all DCS cockpit buttons. As soon as I use modifiers the key after the modifier seems to be too short for some DCS buttons. But not for others. So if ED could standardize all button timings to the better ones it would be great.
Tom Kazansky Posted November 19, 2019 Author Posted November 19, 2019 (edited) Have to add a question here: Is it possible to mod the timing of cockpit buttons? (in lua files?) Edited November 19, 2019 by Tom Kazansky
Tom Kazansky Posted November 20, 2019 Author Posted November 20, 2019 (edited) meanwhile I started figuring out what AutoHotKey-Scripting (AHK) has to offer. I'm quite a noob with it but I managed to make the problem less annoying. And it proves that it is a timing problem that some cockpit buttons of DCS have more than others! I now use a skript that takes my original and too short buttonbox key input like a LCTRL+RSHIFT+0 fox example and generate the same output LCTRL+RSHIFT+0 with a delay of 85ms between 0-press and 0-release: for those who know AHK: #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. ; #Warn ; Enable warnings to assist with detecting common errors. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. #UseHook newTiming := 85 >+<^0:: SendInput {Blind}{rshift down}{lctrl down}{0 down} sleep, newTiming SendInput {Blind}{0 up}{lctrl up}{rshift up} return the bold part does the job for LCTRL+RSHIFT+0 The result is, that now 2 out of 3 up to 4 out of 5 kepresses are working as they should with the animation of the cockpit button in DCS working correctly. Without AHK I had like 1 out of 20 Edited November 20, 2019 by Tom Kazansky
Tom Kazansky Posted November 20, 2019 Author Posted November 20, 2019 (edited) although the tests with AutoHotKey (AHK) showed that the timing problem some DCS cockpit buttons have (like MFD-OSB-keys of the Viper or some UFC keys of the Hornet) can be reduced, I still can't recommend to use AHK. With AHK I sometimes get the key inputs without the modifiers. So a "RCtrl+LShift+3" does a simple "3" from time to time. Maybe there is a AHK expert out there who can help me out of this? I'd still prefer by far that a ED dev looks into the different timings that the DCS cockpit buttons have and may be change them to the better (e.g. good: Hornet MFD-OSBs, bad: Viper MFD-OSBs) Can you please help me out of this? It is really annoying not beeing able to press those OSBs in the Viper with my buttonbox. Edited November 20, 2019 by Tom Kazansky
Ant0ine Posted November 20, 2019 Posted November 20, 2019 (edited) although the tests with AutoHotKey (AHK) showed that the timing problem some DCS cockpit buttons have (like MFD-OSB-keys of the Viper or some UFC keys of the Hornet) can be reduced, I still can't recommend to use AHK. With AHK I sometimes get the key inputs without the modifiers. So a "RCtrl+LShift+3" does a simple "3" from time to time. Maybe there is a AHK expert out there who can help me out of this? I'd still prefer by far that a ED dev looks into the different timings that the DCS cockpit buttons have and may be change them to the better (e.g. good: Hornet MFD-OSBs, bad: Viper MFD-OSBs) Can you please help me out of this. It is really annoying not beeing able to press those OSBs in the Viper with my buttonbox. Try Send instead of SendInput. It is a bit slower but more reliable. Edit to add : With SetKeyDelay you can easily tune the delay and press duration. https://www.autohotkey.com/docs/commands/SetKeyDelay.htm Edited November 20, 2019 by Ant0ine
Tom Kazansky Posted November 20, 2019 Author Posted November 20, 2019 Try Send instead of SendInput. It is a bit slower but more reliable. Edit to add : With SetKeyDelay you can easily tune the delay and press duration. https://www.autohotkey.com/docs/commands/SetKeyDelay.htm oh my...!!!! :thumbup::thumbup::thumbup: you are my hero! that does it! I now get 100% perfect results with no wrong inputs, no misses, perfect button animation (so far)! wow.... thanks a lot!!!! :thumbup:
Tom Kazansky Posted November 20, 2019 Author Posted November 20, 2019 (edited) I just saw your EDIT so I have to make myself clear: it was just the "Send" instead of "SendInput" that changed everything! Feels lika a complete new Viper! Even better than the Hornet, but I'm going to use this script for Hornet too in the future. BC the button animation looks great. Never saw this before. Thanks again Ant0ine :thumbup: EDIT: I tested SetKeyDelay before and found out that the delays of the modifier downs/ups have no influence to the behaviour so I thought it would be better to slow down only the keys between the modifier actions. btw: I'm still flying the Viper in the background without any problems. Feels really great now! Edited November 20, 2019 by Tom Kazansky
Ant0ine Posted November 20, 2019 Posted November 20, 2019 EDIT: I tested SetKeyDelay before and found out that the delays of the modifier downs/ups have no influence to the behaviour so I thought it would be better to slow down only the keys between the modifier actions. btw: I'm still flying the Viper in the background without any problems. Feels really great now! SetKeyDelay have no influence on SendInput. Note: SetKeyDelay is not obeyed by SendInput; there is no delay between keystrokes in that mode. If you use Send without a predefined SetKeyDelay then I think the default delay is used : If SetKeyDelay is never used by a script, the default Delay for the traditional SendEvent mode is 10. Apparently it is enough to make your keys combinaisons work reliably :thumbup:
gianlu320 Posted November 20, 2019 Posted November 20, 2019 I have a similar problem with the 4 rotaries of the F16 ICP and now I finally understand why thanks to this thread. I am using an ICP replica that has also the four rotaries. The rotaries I use send a key press to the computer. When I am in the key assignment page in dcs and I move the rotary,dcs registers the key press. If I open a word document and I move the rotary I can see the key assigned to that rotary being written in the word document. But when I am in game and I move the rotaries,they are not registered by the sim and they don’t move.
Tom Kazansky Posted November 20, 2019 Author Posted November 20, 2019 I have a similar problem with the 4 rotaries of the F16 ICP and now I finally understand why thanks to this thread. I am using an ICP replica that has also the four rotaries. The rotaries I use send a key press to the computer. When I am in the key assignment page in dcs and I move the rotary,dcs registers the key press. If I open a word document and I move the rotary I can see the key assigned to that rotary being written in the word document. But when I am in game and I move the rotaries,they are not registered by the sim and they don’t move. Exactly the same I experienced before AHK. In the controls setup menu a single press was enough to find the right action but in-game it was1 out of 20. Glad to hear your problem can be solved too.
Tom Kazansky Posted November 20, 2019 Author Posted November 20, 2019 @Ant0ine: I will do some tests with this delay setting. Bc of your post I now understand why my previous tests didn't work. May be it is enough to set a global delay. Would make things even easier. Thanks
gianlu320 Posted November 20, 2019 Posted November 20, 2019 @Tom Kazansky First of all I want to thank you because thanks to you I now have hopes to fix my problem. Before you posted in this thread I didn’t even know what to write in the forum to explain my problem because I didn’t even understand the problem itself. Can I ask you a favour? I am a total noob with software etc.. Could you explain me what exactly I have to set in AHK? Once again thanks a lot !
Tom Kazansky Posted November 20, 2019 Author Posted November 20, 2019 (edited) Thank you. I just installed the free open source AutoHotKey. There is a good introduction guide under "Documentation". Then I made my first AHK file and edited it with simple notepad. A DoubleClick on that file starts the script and you get a tray icon where you can pause and stop it. Very simple an nice. U can use the code I posted above for a single key. You can add those blocks like the last one for each key you want to modify. Here it is again with Ant0ines first tip (I will care for more of his hints tomorrow): #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. ; #Warn ; Enable warnings to assist with detecting common errors. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. #UseHook newTiming := 85 >+<^0:: Send {Blind}{rshift down}{lctrl down}{0 down} sleep, newTiming Send {Blind}{0 up}{lctrl up}{rshift up} return what you have to know: before the :: stands the key that is pressed, where ">" means right, "+" means shift, "<" means left, "^" means ctrl, so in my case it is a RShift+LCtrl+0. Thats all explained in the nice documentation. Edited November 20, 2019 by Tom Kazansky
Tom Kazansky Posted November 20, 2019 Author Posted November 20, 2019 you find the tutorial here: https://www.autohotkey.com/docs/Tutorial.htm software and documentation is here: https://www.autohotkey.com/
gianlu320 Posted November 20, 2019 Posted November 20, 2019 Thanks a lot for this I’m going to try it straight away !!!
rob10 Posted November 20, 2019 Posted November 20, 2019 Glad you got things working Tom! One minor note, it's probably worth using Notepad++ (rather than windows notepad) to do your editing. It gives a more proper output for what a lot of config type files are looking for (proper end-of-lines for one).
Scuby Posted November 21, 2019 Posted November 21, 2019 With SetKeyDelay you can easily tune the delay and press duration. Dude, you are a life saver! Works like a charm for the F-16 ICP data control switch. Thanks! :thumbup: Also thanks to the OP for bringing this issue to the forums. I just couldn't figure out why some AHK keypresses would not give a return in 3D. Now I know. :joystick: System | AMD RYZEN 5900X | INNO3D RTX 4080 ICHILL | G.SKILL 3200-C14 32GB | ASUS X570-E GAMING | LG 27GP850 2K/QHD | HIDs | TM HOTAS COUGAR | VPC WARBRD BASE | MFG CROSSWIND V2 | G.TRIX JETSEAT KW908 | HP REVERB G2 | Mods | Rel4y standalone USB + 14bit GMR | Delta Sim Force TDC slew | MFG Hydraulic damper | YouTube | ScubyFlying | 31st VFS
Tom Kazansky Posted November 21, 2019 Author Posted November 21, 2019 Thank you. Every post that shows how much people have encountered that timing problem increases the chance that ED looks into it and may be standardize the needed timings for all buttons.
Tom Kazansky Posted November 21, 2019 Author Posted November 21, 2019 so, Ant0ine, I just took a look at your SetKeyDelay-hint, and it seems to work exactly as goog as a delay on the key between the modifiers alone. This reduces the code and offers an elegant solution for the timing problem. My problem in the beginning was, that when you create a new AHK file by rightklick on the desktop\new\AHK-file it automatically adds a line with "SendMode Input" so every "send" wil be interpreted as a "sendinput". That's why my SetKeyDelay and the whole thing had some issues. Thanks to your explanation above I'm no aware of the needed facts. Thanks again!!
Tom Kazansky Posted May 29, 2020 Author Posted May 29, 2020 (edited) After the stable update to 2.5.6 the problem is gone for F-16C's DDI buttons, the ICP number keys and the RCL, ENTR. (I don't see every single button animation but the functions work perfectly.) The issue still exists for the Data Control Switch on the ICP (RTN/SEQ,up,down). It only works (for my special 2nd keyboard) with the AHK-tweak. Edited May 29, 2020 by Tom Kazansky
shu77 Posted June 16, 2020 Posted June 16, 2020 After setting up my new POS keyboard last night and trying to go for a fly tonight I struck this problem after a very frustrating night with customer support for the keyboard I found this thread and have been able to get it working so just stopping by to say thanks for your code Tom Hornet, Super Carrier, Warthog & (II), Mustang, Spitfire, Albatross, Sabre, Combined Arms, FC3, Nevada, Gulf, Normandy, Syria AH-6J i9 10900K @ 5.0GHz, Gigabyte Z490 Vision G, Cooler Master ML120L, Gigabyte RTX3080 OC Gaming 10Gb, 64GB RAM, Reverb G2 @ 2480x2428, TM Warthog, Saitek pedals & throttle, DIY collective, TrackIR4, Cougar MFDs, vx3276-2k Combat Wombat's Airfield & Enroute Maps and Planning Tools
Recommended Posts