Forum Discussion
Get rid of the key(3)'EVENT and just use the value of key, as that will get rid of the error. You clk'EVENT already describes the clock for a register, and you can only have one clock for each register. Doug Smith's book should give you some good direction, although opening almost any VHDL file will show you the standard method for doing flops(Doug Smith's book will clarify what is going on). I think I mentioned this before, but I really think understanding schematics is a good way to start coding, even if you're writing VHDL/Verilog. If you're just starting coding, and can't imagine what the code you're writing would look like as a schematic, than you're in trouble. (The original code with multiple 'EVENT lines is a good example, is I don't know how to "draw" that.)
The second thing I would stay away from in VHDL is variables, and try to always use Signals. Signals represent physical nets in the design, and again would map to something in a schematic. I had a long argument with someone who loved Variables about this. He spent a lot of time trying to come up with logic where Variables did a better job than Signals. On all but one, I was able to do the same thing, in a more concise manner, with Signals. But the point is that if you're new to VHDL, it will keep you writing code that physically makes sense, rather than writing algorithms where you have no idea how they get synthesized and what comes out the other side. Finally, for your design, the fix I mentioned will get it to compile, but probably won't be what you want. If your level-sensitive to key, then if the user holds down the key for more than one clock cycle(and I'd like to meet the person who doesn't do that), then the pointers will keep iterating for many clocks. There are many ways to fix this, depending on how much caution you want to build in. Most likely you want a separate process for each key that is based on key'EVENT, where the register gets the inversion of itself(i.e. a toggle register where key(#) is the clock). THen you need to move that signal into your main clk domain, so have the output of that register feed two registers clocked by clk'EVENT. Take the output of those two registers and feed them into an XOR gate, which will go high whenever the two registers are not equal(i.e. an edge detect). That should be a good starting point. It may not be full-proof enough if your pushbuttons are launch warheads(I don't think we've gotten into metastability, correlation between multiple keys, etc.) but if the failure rate is one out of every trillion key strokes, I'm guessing that's fine for now.