--- mLCDdown = 1 mLCDup = 2 mKeyDelay = 100 -- -- rFactor mRFactorLCD_keys = { 0x36, -- std 0x37, -- standings 0x38, -- pit 0x39, -- vehicle 0x30, -- driving aids. FUCK driving aids. 0xBD, -- extra ( VK_OEM_MINUS 0xBD ) '=' -- race } mRFactorLCD_states = table.getn(mRFactorLCD_keys) mRFactorLCD_state = 0 -- -- rFactor2 mRFactor2LCD_keys = { 0x36, -- std 0x37, -- standings VK_RCONTROL, -- pit (Right CTRL - VK_RCONTROL - 0xA3) 0x38, -- vehicle. Bitch, i’m using TrackMap 0x39, -- driving aids. FUCK driving aids. 0x30, -- extra 0xBD, -- race ( VK_OEM_MINUS 0xBD ) '=' -- penalities } mRFactor2LCD_states = table.getn(mRFactor2LCD_keys) mRFactor2LCD_state = 0 function custom_controlsEvent(deviceType, ctrlType, ctrlPos, value, funcIndex, targetDevice) dev = GetDeviceType(deviceType) if dev == nil then dev = "none" end --print ( string.format("%s [%s] %s:%s = %s => %s (%s)", deviceType, dev, ctrlType, ctrlPos, value, funcIndex, targetDevice) ) if funcIndex == -1 then if dev == "SLI-PRO" and ctrlType == 1 and ( ctrlPos == mLCDup or ctrlPos == mLCDdown ) and value == 0 then local Key = nil --if ctrlPos == mLCDup then -- print ( " + LCD up") --else -- print ( " + LCD down") --end local sim = GetContextInfo("simulation") if sim == "rFactor2.exe" or sim == "rFactor.exe" then if sim == "rFactor2.exe" then --print ( " >> rF2 :" , mRFactor2LCD_state) if ctrlPos == mLCDup then mRFactor2LCD_state = mRFactor2LCD_state + 1 elseif ctrlPos == mLCDdown then mRFactor2LCD_state = mRFactor2LCD_state - 1 end mRFactor2LCD_state = mRFactor2LCD_state % mRFactor2LCD_states --print ( " << rF2 :" , mRFactor2LCD_state) Key = mRFactor2LCD_keys[mRFactor2LCD_state + 1] elseif sim == "rFactor.exe" then --print ( " >> rF :" , mRFactorLCD_state) if ctrlPos == mLCDup then mRFactorLCD_state = mRFactorLCD_state + 1 elseif ctrlPos == mLCDdown then mRFactorLCD_state = mRFactorLCD_state - 1 end mRFactorLCD_state = mRFactorLCD_state % mRFactorLCD_states --print ( " << rF :" , mRFactorLCD_state) Key = mRFactorLCD_keys[mRFactorLCD_state + 1] end end if Key ~= nil then --print ( "KeyStroke : ", Key ) SetKeystroke(Key, mKeyDelay, "") --SLISleep(10) return 0 end end end return 2 end print ( "gugus> + controls" )