How hold a Button arduino micro

hi everyone
i have 2 arduino micro and NRF
they are conected and work perfectly
the problem is
when i push button it connects and disconnects button 5 or 10 times in a second
but
i want T when i push button it connect the button and when i release it T it disconnect the order
my key board have 4 bottoms
F1
F2
cntr
shift

thanks every one
here are the codes

i will be graetful if u fix it

#include <Keyboard.h>
#include <RF24Network.h>
#include <RF24.h>
#include <SPI.h>
RF24 radio(9,10); // (ce,cs)
RF24Network network(radio);
const uint16_t this_node = 00;
const uint16_t other_node = 03;

unsigned int laser_state=0;
const unsigned long my_interval = 500;
unsigned long last_sent;
unsigned int income=0;


void setup(void)
{
  Serial.begin(115200);
  pinMode(9,INPUT_PULLUP);
  SPI.begin();
  radio.begin();
  network.begin(90,this_node);
  pinMode(4,OUTPUT);
  digitalWrite(4,LOW);
}


void loop(void){
  digitalWrite(4,LOW);
  network.update();
  
  if ( network.available() ) {
    RF24NetworkHeader header;
    network.read(header,&income,sizeof(income));
    if(income==10){
      Serial.println("f1");
      Keyboard.press(KEY_F1);
      income=0;
    }
    if(income==11){
      Serial.println("f2");
      Keyboard.press(KEY_F2);
      income=0;
    }
    if(income==12){
      Serial.println("ctrl");
      Keyboard.press(KEY_LEFT_CTRL);
      income=0;
    }
    if(income==13){
      Serial.println("shift");
      Keyboard.press(KEY_LEFT_SHIFT);
      income=0;
    }
    Keyboard.releaseAll();
  }

  unsigned long now = millis();
  if ( now - last_sent >= my_interval  )
  {
//    Serial.print("pin ");
//    Serial.println(digitalRead(9));
    last_sent = now;
    laser_state = digitalRead(9);
    RF24NetworkHeader header(other_node);
    bool ok = network.write(header,&laser_state,sizeof(laser_state));
  }
}

This is a bit confusing. Are you using the same pin for two different purposes ?