LED pinout for Matrix keypad

i am new to this aurdino. Herewith my code is attached its 5x4 matrix push button box for usb console, we can connected row and column pins for 20 buttons . But all i want is LED on when i press a single button EX: {0,1,2,3} -When i press 3 i want LED on off and its 3 pin ON-OFF toggle switch ,kindly help me sorry for my english.Thanks


#include <Joystick.h>

#include <Keypad.h>
#define NUMBUTTONS 20
#define NUMROWS 5
#define NUMCOLS 4
const int ROW_NUM = 5; //four rows
const int COLUMN_NUM = 4; //three columns

char keys[ROW_NUM][COLUMN_NUM] = {

byte pin_rows[ROW_NUM] = {10, 9, 8, 7,6}; //connect to the row pinouts of the keypad
byte pin_column[COLUMN_NUM] = {5, 4, 3,2}; //connect to the column pinouts of the keypad

Keypad buttbx = Keypad( makeKeymap(keys), pin_rows, pin_column, ROW_NUM, COLUMN_NUM );

 false, false, false, false, false, false,
 false, false, false, false, false);

void setup() {


void loop() { 
void CheckAllButtons(void) {
     if (buttbx.getKeys())
      for (int i=0; i<LIST_MAX; i++)   
          if ( buttbx.key[i].stateChanged )   
           switch (buttbx.key[i].kstate) {  
                   case PRESSED:
                   case HOLD:
                             Joystick.setButton(buttbx.key[i].kchar, 1);
                   case RELEASED:
                   case IDLE:
                             Joystick.setButton(buttbx.key[i].kchar, 0);

Please follow the instructions in Read this before posting a programming question and put code tags round the code in your post to remove the italics

Thanks for updating the code.

What is the joystick doing? You don’t mention it in your description.