0

As an owner of a Logitech G600, there are a lot of buttons on the side of the mouse (16 to be exact).

In the software that comes with the mouse you can only set keybinds using what you can find on the keyboard.

On some other mice that I've seen, they have binds like "MOUSE_4"

My question is: Can I create commands like "MOUSE_X" that I can assign to all of my mouse buttons - which aren't naturally available to me.

EDIT:

Because you can bind the keys to run a script, is there a script i could use to issue a command of my choice

e.g. when button G16 is pressed, return "MOUSE_8"

1
  • 3
    I'm voting to close this question as off-topic because it doesn't actually have anything to do with gaming, but rather, with a specific mouse. We require that questions be explicitly about gaming. Consider reading the FAQ for Super User and seeing if your post fits better there.
    – Schism
    Jan 3, 2016 at 4:45

2 Answers 2

2

I don't know if I understood your question correctly; but from what I understood, you would like to "swap" some buttons of your mouse.

I have a Logitech G700, and a few weeks after buying it, the middle button (wheel click) stopped working. I have since exchanged a thumb button with the middle click button using the Logitech software (Logitech Gaming Software) if I remember right) available from the Logitech website.

Since then, the mouse has the buttons permanently exchanged in its firmware, so that when I use it on another computer/Operating System, the middle click is still assigned to the thumb button of my choice.

So if you want to swap buttons (if I remember right, it is also possible to "duplicate" buttons, i.e. assign the same event to multiple different buttons), that might just do it.


Edit

After understanding the question more clearly, it is about defining new system input events. Since this question is posted in Arqade, I will assume that the Operating System is one of the Windows Family. On other operating systems (such as MacOS or Linux or other UNIXes), the answer would be drastically different.

And as the other answer already indicated, the short answer is "No. You cannot do that.".

The long answer is:

The hardware device defined as "mouse" contains electronics, which register your input into some buffered memory, which is in turn polled by your operating system (if you use USB. If you use PS/2 the behavior is different and will use interrupts (IRQ) instead of polling - but in the scope of this answer, it is mostly irrelevant). Then the operating system interprets the data obtained via polling, and passes in turn to your application (Game, in our case).

Software wise, the chain is as follow: Mouse firmware (in the mouse) → Mouse Driver (in the OS) → Operating System → Application.

As you can see, this chain involves a handful of different components, and all of them are required to understand an event for it to be passed on.

While your firmware needs to know about different buttons to be able to assign different actions to each of them, and while your driver also needs to understand the corresponding messages (so, different ones) to be able to pass them to the Operating System; windows has a predefined list of understood virtual events for both the mouse and the keyboard, and a predefined list of mouse_event flags. While I don't know if/when those VK_* constants are actually used for the mouse handling (I know they are for the keyboard), it is clear from both lists that only five mouse buttons are supported by windows. This is confirmed here.

So, why did I type all this, if it is indeed impossible to do what you want?

Because the limitation here is Windows, and there is a way (without using a different Operating System) to circumvent that limitation. That way is: to use unassigned but defined key codes. I am not talking about the key codes such as VK_A or VK_0 that you might want to use in your game (A is pretty useful in FPSes for strafing left, for example); but key codes such as VK_F13 to VK_F_24 (included) for example, which are not used, because they correspond to obsolete Function keys that aren't present on any modern keyboard (as far as I know).

That would extend the possible number of mouse buttons from five to seventeen. If needed, you might also decide to use a couple of other key codes that aren't used such as VK_Print, in order to extend the number of available buttons to all the buttons you have.

That would make all your buttons available in any game that uses the Microsoft Windows API to scan for input. So virtually any windows game.

Finally: I am not 100% certain that there is no way in Microsoft Windows to actually use more than 5 mouse buttons at a given time (even if the doc says so), but using unused VK_ constants will work.

As correctly remarked by MSalters in the comments, it is possible for games which are using DirectInput (part of DirectX) to recognize up to 8 buttons. While this is far from sufficient for fully answering the question, it is so far the best alternative. Unfortunately, it requires the game to implement it (which should be fairly common, since it is also used for standard controllers and such).

So far, I have actually no idea how to simulate a F_13 or F_24 key as autohotkey does not work with the Logitech Gaming Software. I will post a complete solution here as soon as I find one.

HTH.

7
  • I know how to assign buttons and functions, I want to find a way to assign keys that don't (yet) exist, such as "mouse_2".
    – David K.
    Jan 2, 2016 at 15:54
  • @DavidK. how do you define "keys that don't (yet) exist"? Do you want to be able to, in your games, see "Mouse_12" or "Mouse_16" for example? Jan 2, 2016 at 16:27
  • Exactly that! And be able to assign things like "Mouse_12" and "Mouse_16" to the buttons on the mouse
    – David K.
    Jan 2, 2016 at 16:41
  • 1
    Incorrect, Windows actually knows about 8 mouse buttons since IDirectInput8 (Part of DirectX)
    – MSalters
    Jan 2, 2016 at 23:56
  • 1
    AFAIK, DirectInput is fairly common in games because it supports gamepads, joysticks and the like.
    – MSalters
    Jan 4, 2016 at 8:34
0

No, you can't.

Those buttons are only exposed to the driver software, you can use the logitech software to bind a key or macro to the button.

Even if there was a way to send "mouse button 16 is pressed" to the game it would have to support that button. Just bind the action to a keyboard key and then send that key via the mouse button.

Not the answer you're looking for? Browse other questions tagged .