1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
---
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" )
|