Hi Nevin, you could use g_Scancode instead of g_InKey=="o"
if g_Scancode == 38 then
-- Do your thing...
end
You can also add the line of code below to you lua script for testing, then just comment it out or delete once tested.
TextCenterOnXColor(50,60,5,"Key Pressed " .. g_Scancode,255,255,255)
The scan key code for "L" will be 38. Keep in mind also that the next key Scancode's is just the last plus 1 in a row on the keyboard 9 times of of 10.
An example of your code would be good to post here as this is hard to gauge with out it.
How many time is it run?
Is the code in a loop for it to be seen?
What happens once its found?
Are you using flags once its found?
With g_Scancode you also need to scan for if no key is pressed i.e. g_Scancode==0 which you would use a flag for it. The next example is to show or hide huds.
Example:
local pressed = 0;
local hud_on = 0;
function hudi_init(e)
end
function hudi_main(e)
--Key Action
if GetScancode() == 38 and pressed == 0 then
if hud_on == 1 then
HideHuds();
hud_on = 0;
pressed = 1;
else
ShowHuds();
hud_on = 1;
pressed = 1;
end
elseif GetScancode() == 0 then
pressed = 0
end
-- Scancode on screen -- comment out or delete once not needed
TextCenterOnXColor(50,60,5,"Key Pressed " .. g_Scancode,255,255,255)
end
Dark Base 900 Pro OJ: Rampage V Ed.10, i7 6950x non-OC, DDR4-3333 64 GB RAM, Win 10/64, Asus Strix GeForce 1080 x 2 MDA mode, Water cooled with an old Victorian cast iron radiator and a industrial leather belt driven fan - That's what you call Steampunked.
Laptop - M17xR3