It's not mechanical. It's essentially a computer that receives the signal from the game, sends a signal back and since the game has such a large window (in computer time, milliseconds) it wouldn't be too hard to program it. There are plans online. Here is what one looks like and here is a video.
so people with no live at all want to look awesome and think guitar hero is worth all there time. Try real guitar and then you realize that guitar hero is ridiculous