Hackaday Prize Entry: A Better Way Of Cheating

Believe it or not, some video games are still developed for the PC. With video games come cheat codes, and when they’re on the PC, that means using a keyboard. You can easily program any microcontroller to send a string of characters over a USB port with the touch of a button. Believe it or not, a lot of people haven’t put these two facts together. [danjovic] has, leading him to build a simple and cheap USB keystroke generator for quickly typing in cheat codes.

[danjovic] is basing his build around a Digispark, a cheap, USB-enabled ATtiny85 dev board. This, of course, means there’s not a lot of pins to play with – there are only four I/O pins, and one of them is connected to ground by a LED. That leaves only three I/O pins, but [danjovic] managed to put seven different cheats in his project using diodes and something that is almost charlieplexing.

If you’re wondering, this is a very inexpensive project. [danjovic] is using a Chinese digispark clone, a handful of 1N4148 diodes, and a few tact switches. Anyone with a well-stocked part drawer or a tenner on eBay could build this. If you want the proof of work for this project, you can check out the demo video below.

26 thoughts on “Hackaday Prize Entry: A Better Way Of Cheating

  1. …or you could just make a resistor voltage divider with one R fixed and the other switched in by each of number of switches and use just one ADC input!

    And since when – “a lot of people haven’t put these two facts together” wrt to USB key macros? Just about every macro keyboard on the market allows you to do this and the Nostromo N52 is infamous for this. You can always add a second and third N52 or macro keyboard to a PC just for autorun macros. And as spacecoyote points out, you don’t even need hardware with HotKey(Net).

    1. I have had issues in the past with using resistors as buttons … Accidentally hitting 2 buttons, power rail fluctuations and lag can all be a problem
      Not to mention the inability to put most micros in a sleep state when using the adc in this manor

      1. If you pick resistors that are close to 2^n, multiple keys can be pressed and detected at the same time. This is just a binary weighted DAC. If the ADC uses the same supply, any small variations would affect both the DAC and ADC by the same percentage and the effects be canceled out.

      2. You got to think outside the box.

        If you pick the values correctly so that when the key(s) you want to wake up the uC is pressed,it crossed the logic threshold. The digital level pin change should be able to wake up the sleeping beauty. Once it is up, then use ADC to figure out who disturbed the beauty sleep.

  2. I did the same on the PS2 using a madcatz IR dongle and using a PC to send the IR codes for each button (after learning each of the ir codes for the button).

  3. Back around (IIRC) 1990, I wrote software for an embedded system that hooked an exercise bicycle into the flight game, “Battlehawks 1942.” You plugged your keyboard and joystick into the embedded system, and the system connected to the keyboard port of a PC/AT. Besides passing through any keyboard and joystick information, pedaling the bike generated “increase velocity” keycodes to the aircraft, with the rate of generation dependent on bicycle speed, and the joystick caused varying resistance (harder when climbing, etc.) for the bike. To prevent “coasting,” the app would periodically insert “decrease velocity” keycodes, so you had to keep pedaling in order to keep flying.

    We only ever built the one prototype – the boss tried to shop it around unsuccessfully, then took it home for his own use.

  4. There is definitely an advantage to having keys in a configuration and location where they are easy to use.
    I use AHK for assigning extra mouse buttons to various things on various software for instance, things that are already available as shortcuts but it’s so much easier and quicker and smoother to have the keys at your fingertips. And the same would apply to a small dedicated hotkey board, which you can put in a location where you are most comfortable with.
    And not just games of course, software like drawing programs or video editing packages also benefit.

  5. Some calculators have pretty nice keypads, with real switches instead of rubber domes or other even less satisfactory switches. Might be nice to use those as the input part.
    Problem though is to know what calculator has the nice keys, they often come in blister packaging now so you can’t try it. But maybe you got some old calculator lying around though.

  6. better choice for the micro controller would be a pro-micro or a teensy more I/O and native USB support if you must use a digispark you can carefully cut the trace to the led to give an I/O

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.