Reply
Logi Nu
Fariic
Posts: 2
Registered: ‎06-19-2010
0

How to: shift + G1 script?

Hello.

G15, older version.

 

I'm wondering if, and how, I would write a script that would allow me to use the shift key to make a G key execute another key press.

 

G1 executes the key press shift 1.

Can I make a script that would allow me to press shift G1 and have it execut the keypress ctrl 1.

 

Basically, I have the G keys assigned for shift 1-6, M2 is ctrl 1-6, and M3 is alt 1-6, but I don't want to have to actually hit the M1-3 tabs to chane the G key function.

 

I don't know how to write a script, and I'm hoping a kind soul here would be able to show me what the script would be so that I can leave the keyboard on M1, but get my Shift, ctrl, and alt presses from the G1-6 keys without switching the use of the M1-3 tabs.

 

Is a script to do this posible?

Would anyone be willing to show me how this script should be written?

Did I epxlain this clearly enough?

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

Re: How to: shift + G1 script?

[ Edited ]

It's as simple as using the function IsModifierPressed("ctrl")

 

example:

function OnEvent(event, arg, family)
  if event == "G_PRESSED" and arg == 1 and family == "lhc" and IsModifierPressed("shift") then
    -- do your code here
  end
end