Reply
Logi Browser
Martin95
Posts: 10
Registered: ‎12-15-2011
0
Accepted Solution

G510 Scripting

Hello,

 

I have a couple of questions regarding scripting...

 

 

I see many people script their keyboard to have the backlights flash in diffrents patterns etc.

 

Is this possible with the G510 keyboard?

 

What software do I need, I have searched it up but I can't find the editor everyone is talking abuout :smileyfrustrated:

 

I have Logitech Gaming Software 8.12 installed + Game panel.

 

Thanks :smileyhappy:

kgober
Posts: 3,765
Kudos: 438
Solutions: 287
Registered: ‎05-28-2009
0

Re: G510 Scripting

the script editor is built into the Logitech software.  there should be a menu option or something to access it.

 

scripts that change your backlight color in various patterns usually tie up the scripting engine so that it can't do anything else, including processing regular G-key presses.  so they're interesting to look at, but not terribly useful.

 

-ken

________________________________
I do not work for Logitech. I'm just a user.
Logi Browser
Martin95
Posts: 10
Registered: ‎12-15-2011
0

Re: G510 Scripting

Okey thanks, I have one major question thow..

 

 

Where can I access the script editor within the software, either I'm blind or it's not there :s

 

Logi Browser
casualgamer
Posts: 16
Registered: ‎12-15-2011
0

Re: G510 Scripting

I'm sure you have found it by now, but  just in case: I found it  in the "Logitech G-series Key Profiler" software, under the "Edit" menu. There is a "Script editor..." entry there.

 

I own a G510 myself (for 2-3 weeks now),  and as for color "patterns" you can only do patterns in time (color cycling/blinking), as there is no individual color for each key.

 

 

OT:  Pretty cool, I did'nt know there was a script editor at all! Atm I'm a bit unsure  what to use it for, it seems a macro recorder should cover most of my needs. Then again I don't know Lua or what it can do.

 

Logi Master II
SpecialK
Posts: 1,119
Registered: ‎07-19-2006
0

Re: G510 Scripting

[ Edited ]

If you're using version 7.0 to 8.12, you right click on a profile (or hover over and select that down arrow) and select "Scripting".

Logi Browser
Martin95
Posts: 10
Registered: ‎12-15-2011
0

Re: G510 Scripting

Thanks for good answers the problem was that I didn't install the program as English version and the name for scripting in my country was really wierd :smileytongue:

 

I have now tried to make some scripts and this is what I have written so far : 

 

Spoiler

function OnEvent(event, arg)

 

if (event == "G_PRESSED" and arg == 1) then

-- G1 has been pressed

ClearLCD()

OutputLCDMessage("Hello world1", 2000)

Sleep(1000)

SetBacklightColor(255, 0, 0)

end

end

 

 

When I press G1 NOTHING happends :smileyfrustrated:

 

I have tried many types of scripts and none of them worked :/

 

Is there any function I need to activate or something?

Logi Master II
SpecialK
Posts: 1,119
Registered: ‎07-19-2006
0

Re: G510 Scripting

When you're in the script editor, the script is loaded, so you should be able to test it right there. Are you even able to see a basic script of:

 

function OnEvent(event, arg)
    OutputLogMessage("event = %s, arg = %s\n", event, arg);
end

 

You should see log output on the bottom pane of the script editor.

Logi Browser
casualgamer
Posts: 16
Registered: ‎12-15-2011
0

Re: G510 Scripting

Nice little test script there! Thanks, it got me testing a little bit :smileyhappy:

 

I tried it too, same result appearantly. But then I selected the profile via the keyboard's LCD "G-series profile selector". I somehow hadn't activated the modified "default" profile (also, I had another same named "default" profile loaded onto the keyboard that was active).

 

So first step was to activate the profile via the keyboard's LCD buttons.

 

I'm pretty sure that should be possible from the  G-series Key Profiler too, but I couldn't get that to work. Maybe because I have meddled with saving profiles on the keyboard on-board memory, I don't know. Anyway, it still didn't show. Then I just expanded the time shown on the LCD, modifying your script a little bit:

 

Spoiler
function OnEvent(event, arg)
    if (event == "G_PRESSED" and arg == 1) then
        -- G1 has been pressed
        ClearLCD()
        OutputLCDMessage("Hello world2", 5000)
        Sleep(5000)
        SetBacklightColor(255, 0, 0)
    end
end

Then I had time to cycle the LCD apps / programs, and "Hello world2" was shown for a little bit!

 

It appears the "G-series scripting display" does not force itself to the foreground, even if setting only that app to do that and none of the others (LCD clock, profile selector, etc etc, you do this in "Logitech LCD manager"). I have noticed that with the other apps too, I wanted to LCD clock to be in the foreground when windows starts, but it appears to just be random. Also, I have dis-enabled any apps I don't want (left-hand columns).

 

So step 2 is to not enable any other app than the "G-series scripting display"? That's cumbersome at best, and kind of useless?

 

Actually, I just removed the check-marks for all apps except the scripting display, under the "G510" column (the right-hand side column in Logitech LCD manager - programs). Then, when no scripts (nor apps) runs, there is the default LCD "screen saver". Then you can see the script's LCD output when run.

 

I'm guessing it's a bug that the apps don't force themself to the foreground, thus the LCD scripting don't go to the foreground either. I can kind of understand if you select more than one app to be "the forground app", it will be random, or the last app started. (But apps like the clock for example updates itself all the time, probably others too, still, they shold not be in the foreground if another foreground app is started? Especially if they are not a "foreground app"!)

 

Logi Master II
SpecialK
Posts: 1,119
Registered: ‎07-19-2006
0

Re: G510 Scripting

Not sure why it doesn't work for you, but works perfectly for me. You really shouldn't have to do anything to get it to work. The only thing is that the "G-series profile selector" must be 'checked' in the list of LCD applets.

Logi Browser
Martin95
Posts: 10
Registered: ‎12-15-2011
0

Re: G510 Scripting

I have now managed to get a message on the LCD screen :smileyhappy:

 

Problem is no mather how hard I try, I can't change backlights :smileyfrustrated: