Adding buttons to a mouse.

B0ilerPlate

Sep 14, 2014
15
Joined
Sep 14, 2014
Messages
15
So I found an old mouse that I had sitting around, and decided to take apart. Then, it struck me. "What if I could make a gaming mouse out of this?" So I looked around to see if there was any way to add buttons to this wired optical mouse. (Logitech Indigo 3) I couldn't find anything. Does anybody know how to do this? If you need I can post the pictures of the insides of the mouse.
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
Everything in a mouse is done inside the chip. If the chip is designed for use in other models of mice that have more buttons, it may have pins that you can connect to extra buttons. But if it doesn't, you don't have any options.
 

Gryd3

Jun 25, 2014
4,098
Joined
Jun 25, 2014
Messages
4,098
Everything in a mouse is done inside the chip. If the chip is designed for use in other models of mice that have more buttons, it may have pins that you can connect to extra buttons. But if it doesn't, you don't have any options.
As Kris has mentioned, the chip inside the Mouse will determine what you can or can't easily accomplish. Worst case, if you can't tie additional buttons into the mouse, you can stuff extra hardware in the mouse.
There are example projects online that show you how to program a PIC, AVR, Arduino, etc. to act as a HID. (Human Interface Device) If your willing to do this you can add as many buttons as you can physically fit. To avoid having to mess with the optical tracking... just cram the internals from a small usb hub inside the mouse as well. Mouse and your Microcontroller get wired to the hub, and the hub gets wired to the mouse's original wire to the computer.

This trick has been used to hide mass storage devices in mice, it can easily be adapted to add an additional HID device.
 

B0ilerPlate

Sep 14, 2014
15
Joined
Sep 14, 2014
Messages
15
Thanks Gryd3, now I can pull out my Arduino Due! I'm going to have to learn programming, it's not really my forte... :/
 

Gryd3

Jun 25, 2014
4,098
Joined
Jun 25, 2014
Messages
4,098
Thanks Gryd3, now I can pull out my Arduino Due! I'm going to have to learn programming, it's not really my forte... :/
Well, you can practice on your Due, but it may be too big to cram in your mouse ;)

Take a look here : https://learn.adafruit.com/trinket-usb-keyboard/overview
This should give you all the steps you need to get an Arduino compatable device to operate as a USB HID devcie.
Once you are confident, pick up a smaller arduino or other compatable device and cram it inside ;)

One other item you will need it a USB hub you can hack apart. Something small and cheap. You don't need special features, any 'passive' hub will do. Something like : http://www.thesource.ca/estore/Prod...line&category=USB_Accessories&product=8007694 but for hopefully less money.

remember you will have to remove the cord from the mouse and connect your arduino and mouse to the hub inside the mouse. Then you can use the mouse cord to finish the connection from the hub to PC.

Best of luck!
 

B0ilerPlate

Sep 14, 2014
15
Joined
Sep 14, 2014
Messages
15
Hey, Gryd3? Just asking, I've figured out the mousemove and button commands already, and I have every internal part (and buttons) ready, but I can't seem to find any CMOS sensors. Any idea where to get a good one?
 

Gryd3

Jun 25, 2014
4,098
Joined
Jun 25, 2014
Messages
4,098
Hey, Gryd3? Just asking, I've figured out the mousemove and button commands already, and I have every internal part (and buttons) ready, but I can't seem to find any CMOS sensors. Any idea where to get a good one?
I don't have any experience with CMOS sensors unfortunately... I would check the regular sources (like digikey).

Are you building a new mouse from scratch? (My intention was to recommend sticking two usb devices with a hub into the mouse... the original mouse, then the microcontroller acting as additional buttons)
 

B0ilerPlate

Sep 14, 2014
15
Joined
Sep 14, 2014
Messages
15
I was thinking of doing that, but doing it from scratch is more fun ;). The main reason is that conventional mouses don't have as much response time as, say, the Razer Naga Hex, or the Rat Mice series. This IS meant to be a custom gaming mouse, and some old dell mouse (as easy as they are to find) with low DPI is, well, weak.
 

Gryd3

Jun 25, 2014
4,098
Joined
Jun 25, 2014
Messages
4,098
haha, well. Super props to you for taking that on, and good on you for getting as far as you did.
Hopefully someone can chime in to help you with the cmos sensor, as I'm in over my head for that part.
 

B0ilerPlate

Sep 14, 2014
15
Joined
Sep 14, 2014
Messages
15
Also, I have another question. This is off topic from the mouse, but I saw this video:
, of this guy, he managed to hook up a mouse and keyboard to the PS4. Now something like this already exists (Xim4) but the Xim is 114 DOLLARS. As a future project, I just wanted to see your opinion on how he did it, since he never showed the entire process. He seems to be using a sort of micro controller, with a USB hub to connect the Keyboard, mouse AND PS4 Controller to it, and maybe uses the micro controller to trick the PS4 into thinking it's a PS4 controller. Just want your opinion.
 

Gryd3

Jun 25, 2014
4,098
Joined
Jun 25, 2014
Messages
4,098
You hit the nail on the head. Those devices enumerate like a PS4 controller, Xbox, or Wii controller... The trick is determining what makes them 'special'.
It could be something as simple as mimicking the VID and PID, or it could require sniffing the communication of the original device to discover custom commands that needs to be copied to your microcontroller.
That takes care of the output... the next step is building support for Human interface devices in your microcontroller so that it can act as a 'host' and recognise various keyboards and mice.
 

B0ilerPlate

Sep 14, 2014
15
Joined
Sep 14, 2014
Messages
15
So, basically, the micro needs to think in a sort of A=B format, where A=(A button on mouse or keyboard) and B=(Insert Generic Console Button Name Here). What I don't understand is how I would snoop around inside the PS4 Controller.
 

Gryd3

Jun 25, 2014
4,098
Joined
Jun 25, 2014
Messages
4,098
So, basically, the micro needs to think in a sort of A=B format, where A=(A button on mouse or keyboard) and B=(Insert Generic Console Button Name Here). What I don't understand is how I would snoop around inside the PS4 Controller.
Yup. That may be trickier to implement that you think right away though... as microcontrollers cannot mutli-task very well... so you will need to make some creative use to be able to accurately capture the keyboard/mouse evens on the input.

As far as listening in on the communication... something like https://www.sparkfun.com/products/9544 may work.
Essentially, your going to connect something to the transmission pins/lines to evesdrop on the communication. This is a reverse engineering skill.
You can interpret the data as it comes in with a custom programmed microcontroller, or something like the above mentioned bus pirate, or you could record the communication on a scope or logic analyser. (The later would require you to interpret the 1/0s, whereas the microcontroller method could give you a log of serial data to look at)
 
Top