or just call the function when the key is pressed rather than making an event
Code:
void foo(){
   //do your do
   beep(); // beep once
   
   //or keep beeping
   while(key_cuu){
      beep();
      wait(1);
   }
}

void main(){
   on_cuu = foo();
}