JayPee Posted February 6, 2014 Posted February 6, 2014 (edited) In case anybody has the problem of having keys mapped to functions while you would at the same time have your entire keyboard function as the CDU keypad, here's a solution. If Capslock is toggled ON, typing A will press CDU A, B will press CDU B, spacebar will press CDU SPC and so on.. If Capslock is turned OFF, all keys function as usual and as per your in-sim mappings. In short, Capslock will put your keyboard in and out of 'CDU entry mode'. By having every CDU button including Enter, Clear, Backspace, Period, Slash, etc. mapped directly you'll be entering stuff in your pit faster than a real hog driver. The only thing left to do is map the CDU keys accordingly as described in the Excel sheet. If you want to map the UFC keys as well that is up to you, as you can see only the CDU is affected by the script. UPDATED: Script included an error for the CDU Plus and CDU Minus function. Fixed in v2.1 now.CDU_Keyboard_v2.1.zip Edited February 8, 2014 by JayPee 1 i7 4790K: 4.8GHz, 1.328V (manual) MSI GTX 970: 1,504MHz core, 1.250V, 8GHz memory
tintifaxl Posted February 6, 2014 Posted February 6, 2014 Yes this is a nice solution. I had it this way and then had to redo everything after each update so I gave up on it. Windows 10 64bit, Intel i9-9900@5Ghz, 32 Gig RAM, MSI RTX 3080 TI, 2 TB SSD, 43" 2160p@1440p monitor.
Milli Posted February 7, 2014 Posted February 7, 2014 Thanks JayPee. Will take a look at this. Regards, Milli
Milli Posted February 7, 2014 Posted February 7, 2014 Any chance of the autohotkey source code for the executable JayPee? Regards, Milli
JayPee Posted February 7, 2014 Author Posted February 7, 2014 Reverse eng. it? I'll post the script when I'm back home tomorrow. i7 4790K: 4.8GHz, 1.328V (manual) MSI GTX 970: 1,504MHz core, 1.250V, 8GHz memory
Milli Posted February 7, 2014 Posted February 7, 2014 Reverse eng. it? I'll post the script when I'm back home tomorrow. Thanks JayPee.
RpSPT Posted February 7, 2014 Posted February 7, 2014 Have been using Autohotkey for the same usage since 2012. Altough I never quite fully refined my script as it works as it is. Been using double toggle with both ScrLk and Capslock having to be on to write CDU. Less prone for accidents with double safety. If you make your script in a way that it uses default controls that are set for CDU (LCtrl + LWin + key) you dont have to change anything after updates, unless they change default keys...
JayPee Posted February 8, 2014 Author Posted February 8, 2014 Yes that is correct. However, my biggest issue was that I have mapped several letter keys as modifiers. This is probably very unusual but I set up my keyboard to have all modifiers be mapped in an ergonomic way. To give an idea, A + Hat: DMS, S + Hat: CMS, D + Hat: TMS, and so on.. With my very limited joystick this ensures I can have my left hand rest at the same spot on the keyboard for most of the time while having all HOTAS functions (and some more) within reach. Nevertheless, this causes the default combination of two modifiers + such a letter to not work anymore for the CDU as DCSW cannot treat a key as modifier and normal key simultaneously. Hence I had to introduce an additional step by mapping Capslock ON + a key to a combination which 1) does not include only modifiers and 2) which uses a combination of which I'm sure is not used for anything else. This caused me to pick the rather complex alternative mappings for the CDU. I'll be posting the script later on as promised. i7 4790K: 4.8GHz, 1.328V (manual) MSI GTX 970: 1,504MHz core, 1.250V, 8GHz memory
JayPee Posted February 8, 2014 Author Posted February 8, 2014 Here's the script: SendMode Input #SingleInstance Ignore #If GetKeyState("CapsLock", "T") a:: send {Rshift down}{Rctrl down}{Ralt down}1{Rshift up}{Rctrl up}{Ralt up} Return b:: send {Rshift down}{Rctrl down}{Ralt down}2{Rshift up}{Rctrl up}{Ralt up} Return c:: send {Rshift down}{Rctrl down}{Ralt down}3{Rshift up}{Rctrl up}{Ralt up} Return d:: send {Rshift down}{Rctrl down}{Ralt down}4{Rshift up}{Rctrl up}{Ralt up} Return e:: send {Rshift down}{Rctrl down}{Ralt down}5{Rshift up}{Rctrl up}{Ralt up} Return f:: send {Rshift down}{Rctrl down}{Ralt down}6{Rshift up}{Rctrl up}{Ralt up} Return g:: send {Rshift down}{Rctrl down}{Ralt down}7{Rshift up}{Rctrl up}{Ralt up} Return h:: send {Rshift down}{Rctrl down}{Ralt down}8{Rshift up}{Rctrl up}{Ralt up} Return i:: send {Rshift down}{Rctrl down}{Ralt down}9{Rshift up}{Rctrl up}{Ralt up} Return j:: send {Rshift down}{Rctrl down}{Ralt down}0{Rshift up}{Rctrl up}{Ralt up} Return k:: send {Rshift down}{Rctrl down}{Rwin down}1{Rshift up}{Rctrl up}{Rwin up} Return l:: send {Rshift down}{Rctrl down}{Rwin down}2{Rshift up}{Rctrl up}{Rwin up} Return m:: send {Rshift down}{Rctrl down}{Rwin down}3{Rshift up}{Rctrl up}{Rwin up} Return n:: send {Rshift down}{Rctrl down}{Rwin down}4{Rshift up}{Rctrl up}{Rwin up} Return o:: send {Rshift down}{Rctrl down}{Rwin down}5{Rshift up}{Rctrl up}{Rwin up} Return p:: send {Rshift down}{Rctrl down}{Rwin down}6{Rshift up}{Rctrl up}{Rwin up} Return q:: send {Rshift down}{Rctrl down}{Rwin down}7{Rshift up}{Rctrl up}{Rwin up} Return r:: send {Rshift down}{Rctrl down}{Rwin down}8{Rshift up}{Rctrl up}{Rwin up} Return s:: send {Rshift down}{Rctrl down}{Rwin down}9{Rshift up}{Rctrl up}{Rwin up} Return t:: send {Rshift down}{Rctrl down}{Rwin down}0{Rshift up}{Rctrl up}{Rwin up} Return u:: send {Rshift down}{Ralt down}{Rwin down}1{Rshift up}{Ralt up}{Rwin up} Return v:: send {Rshift down}{Ralt down}{Rwin down}2{Rshift up}{Ralt up}{Rwin up} Return w:: send {Rshift down}{Ralt down}{Rwin down}3{Rshift up}{Ralt up}{Rwin up} Return x:: send {Rshift down}{Ralt down}{Rwin down}4{Rshift up}{Ralt up}{Rwin up} Return y:: send {Rshift down}{Ralt down}{Rwin down}5{Rshift up}{Ralt up}{Rwin up} Return z:: send {Rshift down}{Ralt down}{Rwin down}6{Rshift up}{Ralt up}{Rwin up} Return space:: send {Rshift down}{Ralt down}{Rwin down}7{Rshift up}{Ralt up}{Rwin up} Return backspace:: send {Rshift down}{Ralt down}{Rwin down}8{Rshift up}{Ralt up}{Rwin up} Return delete:: send {Rshift down}{Ralt down}{Rwin down}9{Rshift up}{Ralt up}{Rwin up} Return .:: send {Rshift down}{Ralt down}{Rwin down}0{Rshift up}{Ralt up}{Rwin up} Return /:: send {Rshift down}{Rctrl down}{Ralt down}{Rwin down}1{Rshift up}{Rctrl up}{Ralt up}{Rwin up} Return -:: send {Rshift down}{Rctrl down}{Ralt down}{Rwin down}2{Rshift up}{Rctrl up}{Ralt up}{Rwin up} Return =:: send {Rshift down}{Rctrl down}{Ralt down}{Rwin down}3{Rshift up}{Rctrl up}{Ralt up}{Rwin up} Return ]:: send {Rshift down}{Rctrl down}{Ralt down}{Rwin down}4{Rshift up}{Rctrl up}{Ralt up}{Rwin up} Return [:: send {Rshift down}{Rctrl down}{Ralt down}{Rwin down}5{Rshift up}{Rctrl up}{Ralt up}{Rwin up} Return \:: send {Rshift down}{Rctrl down}{Ralt down}{Rwin down}6{Rshift up}{Rctrl up}{Ralt up}{Rwin up} Return #If i7 4790K: 4.8GHz, 1.328V (manual) MSI GTX 970: 1,504MHz core, 1.250V, 8GHz memory
JayPee Posted February 8, 2014 Author Posted February 8, 2014 SendMode Input Enables a DirectInput compatible way to enter commands in the game #SingleInstance Ignore If you run the script while it is already running, it does not start a 2nd instance neither does it bug you with pop-ups/messages. #If GetKeyState("CapsLock", "T") Enables the 'if Capslock is enabled' condition for everything until the condition is terminated. a:: Tells the script it has to monitor the 'A' key being pressed. send {Rshift down}{Rctrl down}{Ralt down}1{Rshift up}{Rctrl up}{Ralt up} Tells the script to press Rshift+Rctrl+Ralt+1 and releases it upon pressing/releasing 'A'. Return Ends the entry for the 'A' key. #If Terminates the Capslock condition. i7 4790K: 4.8GHz, 1.328V (manual) MSI GTX 970: 1,504MHz core, 1.250V, 8GHz memory
Milli Posted February 8, 2014 Posted February 8, 2014 Thanks JayPee for the script and for the explanation. Regards, Milli
RpSPT Posted February 8, 2014 Posted February 8, 2014 (edited) Yes that is correct. However, my biggest issue was that I have mapped several letter keys as modifiers. This is probably very unusual but I set up my keyboard to have all modifiers be mapped in an ergonomic way. To give an idea, A + Hat: DMS, S + Hat: CMS, D + Hat: TMS, and so on.. With my very limited joystick this ensures I can have my left hand rest at the same spot on the keyboard for most of the time while having all HOTAS functions (and some more) within reach. Nevertheless, this causes the default combination of two modifiers + such a letter to not work anymore for the CDU as DCSW cannot treat a key as modifier and normal key simultaneously. Hence I had to introduce an additional step by mapping Capslock ON + a key to a combination which 1) does not include only modifiers and 2) which uses a combination of which I'm sure is not used for anything else. This caused me to pick the rather complex alternative mappings for the CDU. I'll be posting the script later on as promised. I dont use keyboard keys as modifiers so I left DCS controls almost unchanged. Only thing that I remember to have been changed was that no more need to press LCtrl when using HOTAS TMS buttons on keyboard. http://forums.eagle.ru/showthread.php?t=98036 I should rewrite my script and check if the loop script that I made back in 2012 works on my current setup to get the script more neat. The good thing about my setup is that it works without having to setup too much after updates. It seems that they made some default setup for Saitek stick so have to delete the Saitek columns after updates but that does not take long. The bad thing about this setup is that every joystick button that uses alphabeth keys had to be mapped within the Autohotkey script. Other way would be to map joystick buttons directly to functions inside game. I dont remember clearly but I think there was some problems about saving the setup properly for later use, and that is why I ended up mapping buttons into autokey script. Edited February 9, 2014 by RpSPT Little editing
Recommended Posts