Logitech G600 mouse with 20+ buttons onboard

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Antony
Posts: 16
Joined: 04 Jun 2017, 05:10

Logitech G600 mouse with 20+ buttons onboard

01 Jul 2020, 12:11

Hello,

I have Logitech G600 mouse with 20 buttons onboard. Also, with G-shift button it's possible to almost double such an amount:
2020-07-01_212245.jpg
2020-07-01_212245.jpg (32.92 KiB) Viewed 8726 times
www.logitechg.com /en-us/products/gaming-mice/g600-mmo-gaming-mouse.910-002864.html

I'm a 3D modeler and use it with Blender.
As far as I know, there are 2 solutions to be able to use the mouse with Autohotkey. First: assign F13-F24 for each button in Logitech's software. Second: let Autohotkey get the keys ID.

So, I have 2 questions:

1. Is there any other "free" hotkeys like F13-F24 in Windows 10? Because these 12 F-buttons isn't enough. I have already reassigned LWin key into F24, and, going to do the same for CapsLock for using it in Blender(it's heavily shortcuts dependent software).

2. How is it possible to let Autohotkey get the keys ID?I have enabled #InstallMouseHook and #InstallKeybdHook however KeyHistory doesn't show any ID for these special G-keys (it shows LMB,RMB etc only).

Thank you for any advice.
Last edited by Antony on 01 Jul 2020, 13:49, edited 1 time in total.
scriptor2016
Posts: 863
Joined: 21 Dec 2015, 02:34

Re: Logitech G600 mouse with 20+ buttons onboard

01 Jul 2020, 13:02

I also have this mouse, but never used the side buttons because I always had a hard time finding the button I needed, not to mention the buttons are so small and clustered into eachother. Maybe I should give it a second try ;)

I think with this mouse you need to assign each of the side buttons in the Logitech software first, and then make your AHK scripts.

So for example, go into the Logitech software, and assign the G16-button as the keystroke q.

Next, create an AHK script such as:

Code: Select all

q::
msgbox, you pressed q
Return
..and then do this for all of the G-buttons on the mouse.

You can get creative and make assign the G-buttons as odd keystrokes, like ctrl-alt-d, or Lwin-shift-6 for example - just so you don't use up all of your common keys which may already be assigned to shortcuts in the software you're using like Blender or Photoshop. So for example if ctrl-alt-d already does something in Photoshop, then you don't want to assign that key combo in the Logitech software - you want to assign brand new key combo's to make sure there is no conflict between the mouse and all your running programs (although there are easy ways around it, such as #IfWinActive, but we can cross that bridge if you begin to run out of unused key combo's).
Antony
Posts: 16
Joined: 04 Jun 2017, 05:10

Re: Logitech G600 mouse with 20+ buttons onboard

01 Jul 2020, 13:33

Thanks for the answer. But I already know such things :)
I've been using AHK for quite some time but on a very basic level.
As an example of my pipeline:
2020-07-01_231944.jpg
2020-07-01_231944.jpg (77.94 KiB) Viewed 8295 times
So I asked 2 direct questions above. I need either assign additional "free" F-like keys, or be able to get the keys ID inside Autohotkey
scriptor2016
Posts: 863
Joined: 21 Dec 2015, 02:34

Re: Logitech G600 mouse with 20+ buttons onboard

01 Jul 2020, 13:43

looks like you're already way ahead of me lol.

Yeah I guess we'd need the key's ID. Even if using the F13-F24 keys, we'd still need a way to assign those to the buttons in the Logitech software.

Maybe there's an .ini file that the Logitech software saves to, which might enable us to just type in "F16" in place of whatever keystroke is already there?
Antony
Posts: 16
Joined: 04 Jun 2017, 05:10

Re: Logitech G600 mouse with 20+ buttons onboard

01 Jul 2020, 13:49

It's already there inside of Logitech G HUB:
2020-07-01_234505.jpg
2020-07-01_234505.jpg (15.47 KiB) Viewed 8130 times
We can drug and drop it.
But these are only 12 keys I know we can use
scriptor2016
Posts: 863
Joined: 21 Dec 2015, 02:34

Re: Logitech G600 mouse with 20+ buttons onboard

01 Jul 2020, 13:59

I'm not sure how to find any more empty keys in Windows, or if there are any left.

I've always just doubled-up on each key so that one key will do a bunch of different things. You're probably way ahead of me, but I have a few scripts that will do something if a key is pressed once, and if pressed twice it will do something else, then 3,4,5,6 times or whatever. This way, just one key can do 10 different things.

Pretty sure you already know this or already have a few scripts of your own but if not I could always post some of it here.
Antony
Posts: 16
Joined: 04 Jun 2017, 05:10

Re: Logitech G600 mouse with 20+ buttons onboard

02 Jul 2020, 00:52

I've always just doubled-up on each key so that one key will do a bunch of different things. You're probably way ahead of me, but I have a few scripts that will do something if a key is pressed once, and if pressed twice it will do something else, then 3,4,5,6 times or whatever. This way, just one key can do 10 different things.
I'm definitely way behind you, because I even didn't know AHK can do such things. Yes, post the scripts please. I think I can learn a lot from it. As I said I use AHK on a very basic level.
User avatar
Scr1pter
Posts: 1277
Joined: 06 Aug 2017, 08:21
Location: Germany

Re: Logitech G600 mouse with 20+ buttons onboard

02 Jul 2020, 06:52

You could also use key combinations as
F13+F14
F13+F15
etc.

This will give you a lot of combinations.
I did that for my Logitech G15.

But I think you have some little logic error (German English :) )
Instead of creating several profiles in G Hub,
you can use just one (F13 till F24) and work with AHK's
#if WinActive

This means your mouse buttons will always send F13 till F24, but depending on the active window, AHK will perform different actions.

Cheers!
Please use [code][/code] when posting code!
Keyboard: Logitech G PRO - Mouse: Logitech G502 LS - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.33.09
Antony
Posts: 16
Joined: 04 Jun 2017, 05:10

Re: Logitech G600 mouse with 20+ buttons onboard

02 Jul 2020, 07:14

Scr1pter wrote:
02 Jul 2020, 06:52
You could also use key combinations as
F13+F14
F13+F15
etc.
Yes, you're right. And I'm using it already:
2020-07-02_170308.jpg
2020-07-02_170308.jpg (14.62 KiB) Viewed 5830 times
But the problem is I can use only ONE (F24 at the picture) button as switcher. All other buttons are at the side panel I can press with thumb only. One button at a time.
So,
F24+F13...F23 - Yes
F13+F14 or F13+F15 - No
Antony
Posts: 16
Joined: 04 Jun 2017, 05:10

Re: Logitech G600 mouse with 20+ buttons onboard

02 Jul 2020, 07:27

Scr1pter wrote:
02 Jul 2020, 06:52
But I think you have some little logic error (German English :) )
Instead of creating several profiles in G Hub,
you can use just one (F13 till F24) and work with AHK's
#if WinActive

This means your mouse buttons will always send F13 till F24, but depending on the active window, AHK will perform different actions.
Yep, I've done it already. Different applications use separated AHK files with #if WinActive (see the picture in my 3rd post)

What I'm not sure - is it possible to make something similar to profiles for an application in AHK? And switch between them?
User avatar
Scr1pter
Posts: 1277
Joined: 06 Aug 2017, 08:21
Location: Germany

Re: Logitech G600 mouse with 20+ buttons onboard

02 Jul 2020, 07:41

Ok, I see.

Yes, you can have different profiles within an application using #if WinActive.

Example:

Code: Select all

#if WinActive(ahk_class Notepad++)
F24::
nppProfile++
if nppProfile = 4
{
  nppProfile= 1
}
return

#if WinActive(ahk_class Notepad++) and nppProfile = 1
F13::
MsgBox, hello 1
return

#if WinActive(ahk_class Notepad++) and nppProfile = 2
F13::
MsgBox, hello 2
return

#if WinActive(ahk_class Notepad++) and nppProfile = 3
F13::
MsgBox, hello 3
return
Check the syntax because I'm using my phone.
You can also work with SoundPlay or ToolTip
to get some optical or/and acoustical feedback.

Cheers!
Please use [code][/code] when posting code!
Keyboard: Logitech G PRO - Mouse: Logitech G502 LS - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.33.09
Antony
Posts: 16
Joined: 04 Jun 2017, 05:10

Re: Logitech G600 mouse with 20+ buttons onboard

02 Jul 2020, 09:18

@Scr1pter
Thank you so much! It would took me a year to figure out how to create and switch profiles! :clap:

Checked the syntax and added a string for initial profile:

Code: Select all

#if WinActive("ahk_class Notepad++")

{
  appProfile = 1
}

F24::
appProfile++
if appProfile = 4
{
  appProfile = 1
}
return

#if WinActive("ahk_class Notepad++") and appProfile = 1
F13::
MsgBox, hello 1
return

#if WinActive("ahk_class Notepad++") and appProfile = 2
F13::
MsgBox, hello 2
return

#if WinActive("ahk_class Notepad++") and appProfile = 3
F13::
MsgBox, hello 3
return
scriptor2016
Posts: 863
Joined: 21 Dec 2015, 02:34

Re: Logitech G600 mouse with 20+ buttons onboard

02 Jul 2020, 23:19

using this code, you can use just one key to send unlimited commands.

"0" means a normal press/release (click) on the mouse button, like a "tap", and "1" means to hold down the mouse button for a little longer (250ms) and then release it.

0-tap the key/button
1-hold the key/button for 250ms (or change this timing in the script to whatever works best for you)

So basically one key can handle as many commands as you wish.

Here's an example:

Code: Select all

Morse(timeout = 250) { ;
   tout := timeout/1000
   key := RegExReplace(A_ThisHotKey,"[\*\~\$\#\+\!\^]")
   Loop {
      t := A_TickCount
      KeyWait %key%
      Pattern .= A_TickCount-t > timeout
      KeyWait %key%,DT%tout%
      If (ErrorLevel)
         Return Pattern
   }
}

~q::
p := Morse()
 

If (p = "0") ; Tap  
{
msgbox, Tap
}

Else If (p = "1") ;Hold
{     
Msgbox, Hold
}

Else If (p = "01") ;Tap, Hold
{     
Msgbox, Tap, Hold
}

Else If (p = "00") ;Tap, Tap
{     
Msgbox, Tap, Tap
}

Else If (p = "000") ;Tap, Tap, Tap
{     
Msgbox, Tap, Tap, Tap
}

Else If (p = "0000") ;Tap, Tap, Tap, Tap
{     
Msgbox, Tap, Tap, Tap, Tap
}

Else If (p = "00000") ;Tap, Tap, Tap, Tap, Tap
{     
Msgbox, Tap, Tap, Tap, Tap, Tap
}

Else If (p = "10000") ;Hold, Tap, Tap, Tap, Tap
{     
Msgbox, Hold, Tap, Tap, Tap, Tap
}


;...you get the picture
Else
Return
Antony
Posts: 16
Joined: 04 Jun 2017, 05:10

Re: Logitech G600 mouse with 20+ buttons onboard

03 Jul 2020, 04:54

@scriptor2016
Wow! We have such a unique functionality inside of Blender, but get it for the whole system - it's awesome! Thank you for sharing it!
I think dbl-press and hold are the most useful. 3-4 etc. are too "clickier" in terms or ergonomic.

I checked the script, and it works perfectly.
But I have no idea how this part works unfortunately:

Code: Select all

Morse(timeout = 250) { ;
   tout := timeout/1000
   key := RegExReplace(A_ThisHotKey,"[\*\~\$\#\+\!\^]")
   Loop {
      t := A_TickCount
      KeyWait %key%
      Pattern .= A_TickCount-t > timeout
      KeyWait %key%,DT%tout%
      If (ErrorLevel)
         Return Pattern
   }
}
So, I guess, I need a deep dive into reading the help to prevent asking stupid questions... :)

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], Rohwedder and 164 guests