Click here to Skip to main content
15,890,741 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I would like to change the following in the code, so I would like for the command to be activated upon pressing Left Ctrl button instead of RMB. Can someone please adjust the following code and correct it please ?
Lua
EnablePrimaryMouseButtonEvents(true);

function OnEvent(event, arg)

if IsKeyLockOn("numlock")then

if IsMouseButtonPressed(3)then

repeat

if IsMouseButtonPressed(1) then

repeat

MoveMouseRelative(0,10)

Sleep(33)

until not IsMouseButtonPressed(1)

end

until not IsMouseButtonPressed(3)

end

end

end


What I have tried:

Couldn't locate Lua virtual keyboard commands to adjust it myself
Posted
Updated 30-Sep-18 23:11pm
v2

1 solution

I guess it is the IsModifierPressed("lctrl") call. You have to look up it in the "LUA API reference for LGS scripting", the PDF document installed with LGS.
 
Share this answer
 
Comments
Member 14002954 1-Oct-18 5:24am    
I am total dummy, I have applied the command you told me and it seems fine but script doesn't work now. Is that how it supposed to be in order to function ?

EnablePrimaryMouseButtonEvents(true);

function OnEvent(event, arg)
if IsKeyLockOn("numlock")then
if IsModifierPressed("lctrl") then
repeat
if IsMouseButtonPressed(1) then
repeat
MoveMouseRelative(0,10)
Sleep(33)
until not IsMouseButtonPressed(1)
end
until not IsModifierPressed("lctrl")
end
end
end
CPallini 1-Oct-18 5:48am    
Unfortunately I cannot try the code. I have not LGS installed.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900