The heart of the project is the DigiKeyboard library for Digispark. All i have to do is debounce the buttons and once one of them is stroked (after 100ms of debounce) the cheat is sent by the command
DigiKeyboard.print("cheat");
Digispark have 4 I/O pins but one of them is connected to ground by a LED. So I have 3 pins with pullups to work. The simplest way of doing that is my encoding the buttons using a matrix of diodes. Apart the zero, we have then 7 logic states to work with.
When the first key is pressed, only PB0 goes to ground. The second key makes PB2 go to ground. The third key make both go low. The fourth make PB5 go low and so on.
Unfortunately DigiKey connector disposition is a mess. The I/O pins header misses a GND and VCC what makes life tough if you want to make a plug-in board that needs power. As for this project I only needed a ground reference for the switches and then I used the PB1 pin to work as a virtual ground by using it as an output at zero level. Then I could design a board that can be plugged in directly in DigiSpark.
By the Way the name of the project is a reference to PAC MAN for MSX computers that literally screams Oh Sh** when the player is bit by a ghost whose names are:
Found something. It seems that the detection is related with the time the key stood ON, I mean by how many keyboard scans a given key remained active (press down) before the next press up.