Why is my Verilog code for 4x4 button matrix not scanning?
You seem to be a bit confused about what an always block does.

Every time there's a posedge clk, ALL of the statements inside the block are executed, and the LAST assignment to each signal is the one that applies. All of the other statements before that are effectively ignored.

Also, just for conciseness and readability, you don't need to assign each bit of a multi-bit field separately. You could write

keycode[3:0] &lt;= row[3:0];
keycode[7:4] &lt;= col[3:0];


or even just

keycode &lt;= {col, row};


Finally, you'll also want to add a "strobe" or "valid" output to indicate when a key is being pressed (vs. no key pressed). Otherwise, you won't be able to detect the same key pressed twice in a row.

EDIT:

In order to do something sequentially in hardware, you need to set up a state machine. In this case, the row variable can be your state variable. For example:

module keyboardScanner (
  input            clk,
  input            reset,       /* additional input */
  input      [3:0] col,
  output reg [3:0] row,
  output reg [7:0] keyCode,
  output reg       keyValid     /* additional output */
);

  always @(posedge clk) begin
    if (reset) begin
      /* Reset all register variables.
       * Not strictly necessary for synthesis,
       * but the simulator will require it.
       */
      row &lt;= 4'b1000;
      keyCode &lt;= 8'b0;
      keyValid &lt;= 0;
    end else begin
      /* If any column is active in the current row,
       * output the row and column pattern as a keyCode,
       * and assert keyValid. Pause the scanning as long
       * as the key is held down.
       */
      if (col != 4'b0000) begin
        keycode &lt;= {col, row};
        keyValid &lt;= 1;
      end else begin
        keyValid &lt;= 0;
        /* Scan the matrix, one row per clock period
         */
        case (row)
          4'b1000: row &lt;= 4'b0100;
          4'b0100: row &lt;= 4'b0010;
          4'b0010: row &lt;= 4'b0001;
          4'b0001: row &lt;= 4'b1000;
          default: row &lt;= 4'b1000;
        endcase
      end
    end
  end

endmodule // keyboardScanner


EDIT 2

The first version of the code that I posted had a couple of typos in it, plus an actual bug. As originally coded, if a key was held down, the logic would output a series of keyValid pulses as fast as the scanning could cycle. In order to fix this, the simplest thing to do is to pause the scanning when a key is down, as shown above.

The revised code still does not do any debouncing of the keypresses. There's a simple way to add that, too, but that is left as an exercise for the reader.