Reply
Logi Nu
Petercage
Posts: 3
Registered: ‎05-06-2012
0

How to set a toggle feature on my G13 to have shift toggled on and off?

[ Edited ]

Ok so I play an MMO where you have to sprint using shift. I spoke to a really amazing PVPer the other day who says he uses the G13 keyboard just like I do, and he said that I needed to set my sprint feature to toggle on and off. So in other words, I press a button on my G13, and it enables Sprint to continue to be pressed. But then if I press that same button again, it will no longer be holding the shift key down. Now I dont want a repeat option, as in I dont need the G13 to keep on spamming the Shift key, I need it to hold it down. Can someone please explain to me how to go about doing this please?

 

Oh also I dont want a time based Macro. I am aware that I could just set it up so that it holds it down for like 10 seconds or something like that, and then I just press it every 10 seconds. The problem with that is, if I'm in a situation where I need to get my stamina back, thats not going to be viable for me.

Logi Guru
bystander
Posts: 1,121
Registered: ‎06-04-2010
0

Re: How to set a toggle feature on my G13 to have shift toggled on and off?

Are you sure Caplock wouldn't do what you want?

 

It is a fairly easy script for the G13, so that is also an option.

function OnEvent(event,arg, family)
  if family == "lhc" then
    if event == "G_PRESSED" and arg == 1 then
      SprintToggle = not SprintToggle
      if SprintToggle then
        PressKey("lshift")
      else
        ReleaseKey("lshift")
      end
    end
  end
end

 

 

Logi Nu
Petercage
Posts: 3
Registered: ‎05-06-2012
0

Re: How to set a toggle feature on my G13 to have shift toggled on and off?

[ Edited ]

Thanks for the reply, I am not computer savy on any level what so ever, and have no clue where to stick that though =( Can you let me know where to place that please.

 

And yes I did try Capslock as my first choice, but it wouldn't stick.

Logi Guru
bystander
Posts: 1,121
Registered: ‎06-04-2010
0

Re: How to set a toggle feature on my G13 to have shift toggled on and off?

In order to make that script work, you need to right click the profile for the game it will run with, and select scripting.  Remove any default script in the editor and copy paste what I wrote for you.

 

You will also want to adjust the script to work on the button you want it to.

 

look for this little bit within one of the if then statements:

arg == 1

 

1 is the G key it will activate on.  Change that number to what ever G key you want to have activate the script.

Logi Nu
Petercage
Posts: 3
Registered: ‎05-06-2012
0

Re: How to set a toggle feature on my G13 to have shift toggled on and off?

[ Edited ]

Ok so I got the macro to work, but now the problem I have is that when running this macro, I can't click all my abilities. Things that are binded to F1-F11 dont work, and same goes for the Numlock 1-9 keys. Is there a key I can change the Sprint key from instead of Shift to make it so that I can click all my buttons still and have sprint on? I can't use Alt or Ctrl because they do something in the game that cannot be changed. 

kgober
Posts: 3,733
Kudos: 431
Solutions: 283
Registered: ‎05-28-2009
0

Re: How to set a toggle feature on my G13 to have shift toggled on and off?

[ Edited ]

it's my understanding that 'toggle' macros will spam a key if you have delays in the macro, but they will simply hold down the key if the macro has no delays (at least it used to be this way, in older versions).  doing this, you may be able to avoid using Lua scripting at all.

 

does the game allow you to have multiple bindings for each function?  if so, it might help to simply bind both F1 and Shift+F1 to the same action, so that it works regardless of whether Shift is held or not.

 

-ken

________________________________
I do not work for Logitech. I'm just a user.
Logi Guru
bystander
Posts: 1,121
Registered: ‎06-04-2010
0

Re: How to set a toggle feature on my G13 to have shift toggled on and off?

The problem is that game will distinquish between shift-f1 and f1.  To avoid this problem, I'd bind sprint to another key other than shift/ctrl/alt.  Then it won't be an issue, or you can do as kgober said, but that seems like more work.