ir control with button pad

Hi, Im setting up a 20 key button pad and infrared transmitter using the librarys IRLib.h and Keypad.h to control some devices. It seems to be working but you have to keep pushing the buttons for volume up and volume down on the button pad. Is there a way to hold them down so the volume will keep changing until I release the button. My code is: The buttons are are U for up and D for down at the bottom of the code. Thanks

#include <Keypad.h>
#include <IRLib.h>

IRsend My_Sender;

const byte ROWS = 5; 
const byte COLS = 4; 
// Define the Keymap
char keys[ROWS][COLS] = {
    {'F','G','#','*'},
    {'1','2','3','U'},
    {'4','5','6','D'},
    {'7','8','9','B'},
    {'<','0','>','E'} 
};
// Connect keypad ROW4, ROW3, ROW2 ROW1 and ROW0 to these Arduino pins.
byte rowPins[ROWS] = {4, 5, 6, 7, 8};
// Connect keypad COL0, COL1, COL2 and COL3 to these Arduino pins.
byte colPins[COLS] = {13, 12, 11, 10}; 

// Create the Keypad
Keypad kpd = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );

void setup()
{
  Serial.begin(9600);
}

void loop()
{
  char key = kpd.getKey();
  if(key)  // Check for a valid key.
  {
    switch (key)
    {
      
      case '1':
      My_Sender.send(NEC,0xFF6897, 32);
      break;
      
      case '2':
      My_Sender.send(NEC,0xFF9867, 32);
      break;
      
      case '3':
      My_Sender.send(NEC,0xFFB04F, 32);
      break;
      
      case '4':
      My_Sender.send(NEC,0xFF30CF, 32);
      break;
      
      case '5':
      My_Sender.send(NEC,0xFF18E7, 32);
      break;
      
      case '6':
      My_Sender.send(NEC,0xFF7A85, 32);
      break;
      
      case '7':
      My_Sender.send(NEC,0xFF10EF, 32);
      break;
      
      case '8':
      My_Sender.send(NEC,0xFF38C7, 32);
      break;
      
      case '9':
      My_Sender.send(NEC,0xFF5AA5, 32);
      break;
      
      case '0':
      My_Sender.send(NEC,0xFF4AB5, 32);
      break;
      
      case '*':
      My_Sender.send(NEC,551489775, 32); //TV power button
      break;

      case '#':
      My_Sender.send(NEC,0xFF52AD, 32);
      break;

      case 'F':
      My_Sender.send(NEC,0xFF629D, 32); //up button on remote
      break;

      case 'G':
      My_Sender.send(NEC,0xFFA857, 32); //down button on remote
      break;

      case '<':
      My_Sender.send(NEC,0xFF22DD, 32); //left button on remote
      break;

      case '>':
      My_Sender.send(NEC,0xFFC23D, 32); //right button on remote
      break;

      case 'E':
      My_Sender.send(NEC,0xFF02FD, 32); //ok button on remote
      break;

      case 'U':
      My_Sender.send(NEC,551502015, 32); //TV volume up
      break;

      case 'D':
      My_Sender.send(NEC,551534655, 32); //TV volume down
    }
      {
      Serial.println(key);
      }
  }
}

Some remotes send the same code over and over. Some send a special 'repeat' code. You might need to figure out which your original remote does.

To repeat a key, try:

 void loop()
{
  char key = kpd.getKey();
  if(key)  // Check for a valid key.
  {
    while (kpd.isPressed(key)) {
      switch (key)
      {