Click here to Skip to main content
14,176,651 members
Rate this:
 
Please Sign up or sign in to vote.
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 ?
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

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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.
   
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Cookies | Terms of Service
Web03 | 2.8.190525.1 | Last Updated 1 Oct 2018
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100