Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- /// Wrote by islanq 04/29/14 ///
- -- ///////////////////////////////
- EnablePrimaryMouseButtonEvents (true) -- This allows the LButton events to be read
- function OnEvent(event, arg, family)
- OutputLogMessage("event = %s, arg = %s\n", event, arg)
- if event == "PROFILE_ACTIVATED" then -- If the profile is loaded
- SetMouseDPITableIndex(2) -- Set the DPI to my favorite!
- end
- -- /// Let's Start with something easy.
- --{} EXAMPLE # 1 {}____________________________}--
- --{ ___________________________________________}--
- --{ basic starting example_____________________}--
- if event == "MOUSE_BUTTON_PRESSED" and arg == 1 then --{A} If you press LButton then..
- PressMouseButton(1) --{B} Press LButton (down state)
- elseif event == "MOUSE_BUTTON_RELEASED" and arg == 1 then --{C} If you release LButton then...
- ReleaseMouseButton(1) --{D} Release the LButton (up state)
- end
- -- /// Now that you have the basics, let's try something a little more advanced. We'll use a button that is out of the way.
- --{} EXAMPLE # 2 {}_______________________________________}--
- --{ ______________________________________________________}--
- --{ the benefit of this is having control of the downward }--
- --{ as we well as the upward timing_______________________}--
- if event == "MOUSE_BUTTON_PRESSED" and arg == 11 then --{A} If our targed mouse button is pressed..
- PressKey ("lalt") --{-}-------------------------------------------
- Sleep(40) --{B} Press the left alt key, take a rest, press
- PressMouseButton(3) --{-} middle mouse button ----------------------
- elseif event == "MOUSE_BUTTON_RELEASED" and arg == 11 then --{C} ELSEIF.. target button is released.. THEN!
- ReleaseKey ("lalt") --{-}-------------------------------------------
- ReleaseMouseButton(3) --{D} Release left alt & middle mouse button (3)
- end --{-}-------------------------------------------
- --NOTE: I was explicit with my use of LEFT ALT,
- --however, it can be just any ALT with: ("alt")
- -- /// Alternate Way to complete above
- --{} EXAMPLE # 2A {} __________________________}--
- --{ ___________________________________________}--
- --{ to perform a sequence of keystrokes without}--
- --{ up/down control, you can use a macro ______}--
- --{ Step 1: Record your macro in LGS using the mutli key function.
- --{ Step 2: Name your macro!
- --{ Note: At this point you could just assign it to the recorded key. Done, however, those who want to learn can read on.
- if event == "MOUSE_BUTTON_PRESSED" and arg == 11 then --{A} If our targed mouse button is pressed..
- PlayMacro("MyExampleMacro") --{B} Plays MyExampleMacro which you recorded earlier
- elseif event == "MOUSE_BUTTON_RELEASED" and arg == 11 then --{C} If it's a non-repeating macro you can replace this with END
- AbortMacro() --{D} If your macro repeats you need to abort it upon release
- end --NOTE: It should follow it's repeat / toggle per the recording
- end
Advertisement
Add Comment
Please, Sign In to add comment