An Open-Source Gaming Mouse

It’s a shame, that peripherals sold as of higher performance for gaming so often deliver little but aggressive styling. [Wareya] became frustrated with the fragile switches on his choice of gaming mouse, so decided to design his own. In the video that he’s placed below the break, he takes us through all the many choices and pitfalls inherent to these devices

After quite a few iterations he arrived upon a design featuring an RP2040 and an optical sensor easily found in relatively inexpensive mice. The whole design is open source and can be found in a GitHub repository, but for us perhaps the most interesting part of the explanation lies in the use of a three-contact switch, and how the third contact is used to aid in debouncing. In an application in which latency is of paramount importance this is a key design feature of a gaming mouse.

Perhaps it’s a mark of how good computer mice are in general that we see so relatively few projects building them from scratch rather than modifying exiting ones, but despite that a few have made it to these pages. Continue reading “An Open-Source Gaming Mouse”

DIY Gaming Mouse Beats The Competition, Costs Less

We’ve seen plenty of custom keyboards here on Hackaday. Seriously, like more than we can count. But custom mice? Those are far more elusive. Though we wouldn’t be surprised to see that change should this excellent example from [Tyler Richard] catch on.

How the mouse sees the date on a US quarter

The goal was to build a customizable mouse that could match the performance of Logitech’s MX Master 3, but without the $100 USD price tag. In the end, [Tyler] says his mouse is around 10x as responsive thanks to a 1,000 Hz refresh rate, and the total cost is just a fraction of the retail price of the Logitech. Though as you might expect, there’s a catch or two.

For one thing, he says getting your hands on the PixArt PMW3389 mouse sensor in single quantities can be difficult. It seems like he was able to secure a sample because he’s a student, but you’ll have to figure out your own way to con secure one from the company. There’s also no friendly GUI to configure the mouse, and indeed, you’ll need to write some code should you want to modify any of its buttons. Oh, and despite the fact that the cheapo donor mouse you need to use for parts is wireless, the replacement guts you’ll be fitting it with currently only support wired operation.

Alright, we’ll admit it’s not perfect. But it’s still a huge step in the right direction if you care about being able to spin up your own input devices. With some refinement, and perhaps somebody willing to do bulk buy of the sensors, we could see this project becoming quite popular. In the meantime, you may have to settle for a macro stool.

Soap Mouse Is A Slippery Interface For Mid-Air Input

We all have those gnarly hacks that we still think about years after we first saw them. For serial tipster [Inne], one of those is [Patrick Baudisch]’s soap mouse, which is a DIY device for mousing in mid-air that uses components from off the shelf and around the house.

How does it work? The guts are encased in plastic shaped like a flattened pill, which slips into a fuzzy sock. By squeezing it a bit, the plastic pill rotates, spinning the outward-facing sensor round and round. Although we briefly reported on the soap mouse way back in 2006, we think it deserves to be in the spotlight today, especially since there’s a complete PDF guide to building one that’s optimized for gaming. If you want a regular pointing device instead, the conversion is described within.

[Patrick] uses a CompUSA (RIP) mouse in the guide, but any sufficiently slim and also short mouse should work as long as it has a decently long focal range, which is necessary for the sensor to see the hull. Plenty of travel mice out there should fit the bill.

The hull itself is made from two small (empty) bottles of hand sanitizer, chosen for their size, shape, and clarity of plastic. The outermost housing is a baby sock with a snap sewn on. [Patrick] says moving the sock against the plastic is difficult, and has tried various methods for lubrication, such as a bit of mineral oil inside some plastic bags.

Be sure to check out the video after the break, which does a great job of explaining everything from the various types of interaction to construction in 5½ minutes.

Since 2006, [Patrick] has held workshops where people have built their own soap mice. Have you built one? Let us know in the comments. And don’t forget about the Digi-Key-sponsored Odd Inputs and Peculiar Peripherals contest, which runs through July 4th. Declare your independence from regular keyboards and mice and win big!

Continue reading “Soap Mouse Is A Slippery Interface For Mid-Air Input”

Injecting Code Into Mouse Firmware Should Be Your Next Hack

Here’s a DEF CON talk that uses tools you likely have and it should be your next hacking adventure. In their Saturday morning talk [Mark Williams] and [Rob Stanely] walked through the process of adding their own custom code to a gaming mouse. The process is a crash course in altering a stock firmware binary while still retaining the original functionality.

The jumping off point for their work is the esports industry. The scope of esporting events has blown up in recent years. The International 2016 tournament drew 17,000 attendees with 5 million watching online. The prize pool of $20 million ($19 million of that crowdfunded through in-game purchases) is a big incentive to gain a competitive edge to win. Contestants are allowed to bring their own peripherals which begs the questions: can you alter a stock gaming mouse to do interesting things?

The steelseries Sensei mouse was selected for the hack because it has an overpowered mircocontroller: the STM32F103CB. With 128 KB of flash the researchers guessed there would be enough extra room for them to add code. STM32 chips are programmed over ST-Link, which is available very inexpensively through the ST Discovery boards. They chose the STM32F4DISCOVERY which runs around  $20.

Perhaps the biggest leap in this project is that the firmware wasn’t read-protected. Once the data, clock, and ground pads on the underside of the board were connected to the Discovery board the firmware was easy to dump and the real fun began.

They first looked through the binary for a large block of zero values signifying unused space in flash. The injected firmware is designed to enumerate as a USB keyboard, open Notepad, then type out, save, and execute a PowerShell script before throwing back to the stock firmware (ensuring the mouse would still function as a mouse). Basically, this builds a USB Rubber Ducky into stock mouse firmware.

There are a few useful skills that make taking on this project a worthwhile learning experience. To compile your custom code correctly you need to choose the correct offset address for where it will end up once pasted into the firmware binary. The vector table of the original code must be rewritten to jump to the injected code first, and it will need to jump back to the mouse execution once it has run. The program flow on the left shows this. Both of these jumps require the program counter and registers to be saved and restored. The ARM stack is subtractive and the address will need to be updated to work with the added code.

The talk ended with a live demo that worked like a charm. You can check out the code in the MDHomeBrew repo. In this case the PowerShell script adds keyboard shortcuts for DOOM cheats. But like we said before, the experience of getting under the hood with the firmware binary is where the value will be for most people. With this success under your belt you can take on more difficult challenges like [Sprite_TM’s] gaming keyboard hack where the firmware couldn’t easily be dumped and an update binary was quite obsfucated.