Jorik Posted September 29, 2011 Report Posted September 29, 2011 Hi there, I connected my vrinsight CDU2 to my FSUIPC via the entry in the ini file of FSUIPC. I also added a LUA file to the Modules map. I did assign every button with the buttons tab from FSUIPC and selected FSControl and the name of the LUA with the corresponding number in the parameter box. Now every button of my CDU is doing the right action. The only problem is that I need to press every button two times. Can somebody help me out? At the bottom is the LUA enetery. if ipcPARAM == 101 then ipc.control(70166, 536870912) -- LSK 1L ipc.control(70166, 131072) elseif ipcPARAM == 102 then ipc.control(70167, 536870912) -- LSK 2L ipc.control(70167, 131072) elseif ipcPARAM == 103 then ipc.control(70168, 536870912) -- LSK 3L ipc.control(70168, 131072) elseif ipcPARAM == 104 then ipc.control(70169, 536870912) -- LSK 4L ipc.control(70169, 131072) elseif ipcPARAM == 105 then ipc.control(70170, 536870912) -- LSK 5L ipc.control(70170, 131072) elseif ipcPARAM == 106 then ipc.control(70171, 536870912) -- LSK 6L ipc.control(70171, 131072) elseif ipcPARAM == 107 then ipc.control(70172, 536870912) -- LSK 1R ipc.control(70172, 131072) elseif ipcPARAM == 108 then ipc.control(70173, 536870912) -- LSK 2R ipc.control(70173, 131072) elseif ipcPARAM == 109 then ipc.control(70174, 536870912) -- LSK 3R ipc.control(70174, 131072) elseif ipcPARAM == 110 then ipc.control(70175, 536870912) -- LSK 4R ipc.control(70175, 131072) elseif ipcPARAM == 111 then ipc.control(70176, 536870912) -- LSK 5R ipc.control(70176, 131072) elseif ipcPARAM == 112 then ipc.control(70177, 536870912) -- LSK 6R ipc.control(70177, 131072) elseif ipcPARAM == 113 then ipc.control(70178, 536870912) -- INIT REF ipc.control(70178, 131072) elseif ipcPARAM == 114 then ipc.control(70179, 536870912) -- RTE ipc.control(70179, 131072) elseif ipcPARAM == 115 then ipc.control(70180, 536870912) -- CLB ipc.control(70180, 131072) elseif ipcPARAM == 116 then ipc.control(70181, 536870912) -- CRZ ipc.control(70181, 131072) elseif ipcPARAM == 117 then ipc.control(70182, 536870912) -- DES ipc.control(70182, 131072) elseif ipcPARAM == 118 then ipc.control(70183, 536870912) -- MENU ipc.control(70183, 131072) elseif ipcPARAM == 119 then ipc.control(70184, 536870912) -- LEGS ipc.control(70184, 131072) elseif ipcPARAM == 120 then ipc.control(70185, 536870912) -- DEP ARR ipc.control(70185, 131072) elseif ipcPARAM == 121 then ipc.control(70186, 536870912) -- HOLD ipc.control(70186, 131072) elseif ipcPARAM == 122 then ipc.control(70187, 536870912) -- PROG ipc.control(70187, 131072) elseif ipcPARAM == 123 then ipc.control(70188, 536870912) -- EXEC ipc.control(70188, 131072) elseif ipcPARAM == 124 then ipc.control(70189, 536870912) -- N1 LIMIT ipc.control(70189, 131072) elseif ipcPARAM == 125 then ipc.control(70190, 536870912) -- FIX ipc.control(70190, 131072) elseif ipcPARAM == 126 then ipc.control(70191, 536870912) -- PREV PAGE ipc.control(70191, 131072) elseif ipcPARAM == 127 then ipc.control(70192, 536870912) -- NEXT PAGE ipc.control(70192, 131072) elseif ipcPARAM == 128 then ipc.control(70193, 536870912) -- 1 ipc.control(70193, 131072) elseif ipcPARAM == 129 then ipc.control(70194, 536870912) -- 2 ipc.control(70194, 131072) elseif ipcPARAM == 130 then ipc.control(70195, 536870912) -- 3 ipc.control(70195, 131072) elseif ipcPARAM == 131 then ipc.control(70196, 536870912) -- 4 ipc.control(70196, 131072) elseif ipcPARAM == 132 then ipc.control(70197, 536870912) -- 5 ipc.control(70197, 131072) elseif ipcPARAM == 133 then ipc.control(70198, 536870912) -- 6 ipc.control(70198, 131072) elseif ipcPARAM == 134 then ipc.control(70199, 536870912) -- 7 ipc.control(70199, 131072) elseif ipcPARAM == 135 then ipc.control(70200, 536870912) -- 8 ipc.control(70200, 131072) elseif ipcPARAM == 136 then ipc.control(70201, 536870912) -- 9 ipc.control(70201, 131072) elseif ipcPARAM == 137 then ipc.control(70202, 536870912) -- . ipc.control(70202, 131072) elseif ipcPARAM == 138 then ipc.control(70203, 536870912) -- 0 ipc.control(70203, 131072) elseif ipcPARAM == 139 then ipc.control(70204, 536870912) -- +/ ipc.control(70204, 131072) elseif ipcPARAM == 140 then ipc.control(70205, 536870912) -- A ipc.control(70205, 131072) elseif ipcPARAM == 141 then ipc.control(70206, 536870912) -- B ipc.control(70206, 131072) elseif ipcPARAM == 142 then ipc.control(70207, 536870912) -- C ipc.control(70207, 131072) elseif ipcPARAM == 143 then ipc.control(70208, 536870912) -- D ipc.control(70208, 131072) elseif ipcPARAM == 144 then ipc.control(70209, 536870912) -- E ipc.control(70209, 131072) elseif ipcPARAM == 145 then ipc.control(70210, 536870912) -- F ipc.control(70210, 131072) elseif ipcPARAM == 146 then ipc.control(70211, 536870912) -- G ipc.control(70211, 131072) elseif ipcPARAM == 147 then ipc.control(70212, 536870912) -- H ipc.control(70212, 131072) elseif ipcPARAM == 148 then ipc.control(70213, 536870912) -- I ipc.control(70213, 131072) elseif ipcPARAM == 149 then ipc.control(70214, 536870912) -- J ipc.control(70214, 131072) elseif ipcPARAM == 150 then ipc.control(70215, 536870912) -- K ipc.control(70215, 131072) elseif ipcPARAM == 151 then ipc.control(70216, 536870912) -- L ipc.control(70216, 131072) elseif ipcPARAM == 152 then ipc.control(70217, 536870912) -- M ipc.control(70217, 131072) elseif ipcPARAM == 153 then ipc.control(70218, 536870912) -- N ipc.control(70218, 131072) elseif ipcPARAM == 154 then ipc.control(70219, 536870912) -- O ipc.control(70219, 131072) elseif ipcPARAM == 155 then ipc.control(70220, 536870912) -- P ipc.control(70220, 131072) elseif ipcPARAM == 156 then ipc.control(70221, 536870912) -- Q ipc.control(70221, 131072) elseif ipcPARAM == 157 then ipc.control(70222, 536870912) -- R ipc.control(70222, 131072) elseif ipcPARAM == 158 then ipc.control(70223, 536870912) -- S ipc.control(70223, 131072) elseif ipcPARAM == 159 then ipc.control(70224, 536870912) -- T ipc.control(70224, 131072) elseif ipcPARAM == 160 then ipc.control(70225, 536870912) -- U ipc.control(70225, 131072) elseif ipcPARAM == 161 then ipc.control(70226, 536870912) -- V ipc.control(70226, 131072) elseif ipcPARAM == 162 then ipc.control(70227, 536870912) -- W ipc.control(70227, 131072) elseif ipcPARAM == 163 then ipc.control(70228, 536870912) -- X ipc.control(70228, 131072) elseif ipcPARAM == 164 then ipc.control(70229, 536870912) -- Y ipc.control(70229, 131072) elseif ipcPARAM == 165 then ipc.control(70230, 536870912) -- Z ipc.control(70230, 131072) elseif ipcPARAM == 166 then ipc.control(70231, 536870912) -- SP ipc.control(70231, 131072) elseif ipcPARAM == 167 then ipc.control(70232, 536870912) -- DEL ipc.control(70232, 131072) elseif ipcPARAM == 168 then ipc.control(70233, 536870912) -- / ipc.control(70233, 131072) elseif ipcPARAM == 169 then ipc.control(70234, 536870912) -- CLR ipc.control(70234, 131072) end
Pete Dowson Posted September 29, 2011 Report Posted September 29, 2011 Now every button of my CDU is doing the right action. The only problem is that I need to press every button two times. That's simply because the way VRI program their devices it sends an On message on one press and an Off message on the next press, rather than an On when pressed and an Off when released. Therefore you need to assign exactly the same thing twice to every button -- once for press and once for release. The easiest way is probably to edit your [buttons] section in the INI file. Make a straight copy of all of the CDU assigned button lines, add them to the end, renumber the line numbers to follow on, and change the initial "P" (Press) to "U" (Unpress -- R is used for Repeat). Regards Pete
Andydigital Posted September 29, 2011 Report Posted September 29, 2011 In FSUIPC you need to assign the parameter to both the press and release function for each button on the CDU2, its a minor irritation in the way VRinsight make their hardware function. Edit: Pete beat me to it.
prokopiu Posted September 29, 2011 Report Posted September 29, 2011 Hi, I have my CDU I connected and do the following: a function to press the key: function key_press(icode) ipc.control(icode,4194304) ipc.sleep(1) ipc.control(icode,131072) ipc.sleep(1) ipc.control(icode,536870912) end And then the individual keys code with your method: if ipcPARAM == 101 then key_press(70166) elseif ... Hope that help Kosta
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now