Just want to say how grateful I am that you created this script. I was able to adapt it to my preferred buttons on my G600 very easily. It's so nice to have this tone through the Logitech profile instead of having to worry about modifying the Input file through all the mods and updates that go on with this game! Thanks again.
I want to use this for my G600, however it doesn't seem to work in game. If i test the profile in the logitech software it works perfectly, but once i'm in game it breaks... it doesn't change signs and it release the cast key instantly even if i hold the button down. I have made absolutely sure that all keybinds match those in the script.
So hey man, this sounds great, but I've been having troubles with my bloody G602.. instead of being a normal mouse that gives me MB5, MB6 etc, it just gives the mouse numeric key designations, such as MB5 being 1 (not num1, just 1) MB4 2 etc. I tried editing your script to take this into account, but it still doesn't seem to work.. what EXACTLY would I need to be pressing, or how to remap the actual mouse buttons for a working combination? :/
So first of all, I'm quite a LUA-noob myself. This is the first LUA script I wrote because switching signs in W3 was really annoying. But I hope I can still help you. From what I read, you could try to add the "family" argument to the function. It will then look like this:
function OnEvent(event, arg, family).
Additionally I believe you can assign G4 with 4, G5 with 5 etc. So the script as it currently works would maps sign1 to G5 and sign2 to G4. Maybe you have to try different key designations. I don't have a mouse with G-Buttons so sadly I can't test that myself.
Well, I tried what I usually do with changing those binds from 1, 2, 3, 4 etc to num1, num2, num3 etc and just changing it to -- Map num1 to Sign1 and check if it's pressed if event == "MOUSE_BUTTON_PRESSED" and arg == 5 then num1 = true
elseif event == "MOUSE_BUTTON_RELEASED" and arg == 5 then num1_pressed = false ReleaseKey(cast); ReleaseKey(sign1);
Also with G4, 5 keys etc.. but no luck. Guess I have to find exactly how those keys are designated on the G602 since apparently it has nothing to do with the standard MB4, MB5, MB6 etc -.-
EDIT: I uploaded a profile preset for the G600. This should help you adapting the script for your G602. Also please make sure automatic game detection mode is enabled for your mouse and that there are no commands already assigned to your buttons.
You don't need to change anything in the script besides the 3 lines on top. E.g. if you want to map num1 to mouse 5/G5 change line 5 to the following:
sign1 = "num1";
This only works, if you mapped num1 to Igni ingame of course.
I think there's a misunderstanding concerning where the key gets mapped to the mouse button. The code you changed (mb5_pressed to num1) is just a variable that is used as a flag. It does not address the actual button. The addressing happens in the if-statement in combination with the code mentioned above:
if event == "MOUSE_BUTTON_PRESSED" and arg == 5 then
Which roughly translates to: "Check if a mouse button is pressed" and "Check if the mouse button pressed is button 5".
I know someone who has a G600. I'll ask him to borrow me his mouse and see if I can code something so the script also works with G buttons. I can't promise anything, however.
10 comments
If so, would you enlighten me how to do it?
I tried to code it in a way so it's easily adjustable.
But I hope I can still help you.
From what I read, you could try to add the "family" argument to the function. It will then look like this:
function OnEvent(event, arg, family).
Additionally I believe you can assign G4 with 4, G5 with 5 etc.
So the script as it currently works would maps sign1 to G5 and sign2 to G4. Maybe you have to try different key designations.
I don't have a mouse with G-Buttons so sadly I can't test that myself.
if event == "MOUSE_BUTTON_PRESSED" and arg == 5 then
num1 = true
elseif event == "MOUSE_BUTTON_RELEASED" and arg == 5 then
num1_pressed = false
ReleaseKey(cast);
ReleaseKey(sign1);
Also with G4, 5 keys etc.. but no luck. Guess I have to find exactly how those keys are designated on the G602 since apparently it has nothing to do with the standard MB4, MB5, MB6 etc -.-
Also please make sure automatic game detection mode is enabled for your mouse and that there are no commands already assigned to your buttons.
You don't need to change anything in the script besides the 3 lines on top.
E.g. if you want to map num1 to mouse 5/G5 change line 5 to the following:
sign1 = "num1";
This only works, if you mapped num1 to Igni ingame of course.
I think there's a misunderstanding concerning where the key gets mapped to the mouse button.
The code you changed (mb5_pressed to num1) is just a variable that is used as a flag. It does not address the actual button.
The addressing happens in the if-statement in combination with the code mentioned above:
if event == "MOUSE_BUTTON_PRESSED" and arg == 5 then
Which roughly translates to: "Check if a mouse button is pressed" and "Check if the mouse button pressed is button 5".
I know someone who has a G600. I'll ask him to borrow me his mouse and see if I can code something so the script also works with G buttons. I can't promise anything, however.