PS2 blocks communication with Arduino Serial Monitor

I have arduino pro micro(disguised as leonardo) which communicates with PS2 trackpad and sends the data to computer(as a first step), but any PS2 communication blocks the serial monitor.

#include <ps2.h>

/*
   an arduino sketch to interface with a ps/2 mouse.
   Also uses serial protocol to talk back to the host
   and report what it finds.
*/

/*
   Pin 5 is the mouse data pin, pin 6 is the clock pin
   Feel free to use whatever pins are convenient.
*/
PS2 mouse(9, 10);

/*
   initialize the mouse. Reset it, and place it into remote
   mode, so we can get the encoder data on demand.
*/
void mouse_init()
{
  mouse.write(0xff);  // reset
  mouse.read();  // ack byte
  mouse.read();  // blank */
  mouse.read();  // blank */
  mouse.write(0xf0);  // remote mode
  mouse.read();  // ack
  delayMicroseconds(100);
}

void setup()
{
  Serial.begin(115200);
  while(!Serial);
  Serial.println("Hello");
  //mouse_init();
}

/*
   get a reading from the mouse and report it back to the
   host via the serial line.
*/
void loop()
{
  Serial.println("Hello again");
  /*char mstat;
  char mx;
  char my;
  char mz;

  mouse.write(0xeb);  // give me data!
  mouse.read();      // ignore ack
  mstat = mouse.read();
  mx = mouse.read();
  my = mouse.read();
  mz = mouse.read();


  Serial.begin(115200);
  while(!Serial);
  Serial.println(mstat, BIN);
  Serial.println("\tX=");
  Serial.println(mx, DEC);
  Serial.println("\tY=");
  Serial.println(my, DEC);
  Serial.println("\tZ=");
  Serial.println(mz, DEC);
  Serial.println();*/
  delay(1000);  /* twiddle */
}

You should never have Serial.begin() inside loop()!

That doesn't change anything. Serial monitor outputs only "Hello" and "Hello again"

Which ps2 library are you using?

That kind of library. Downloaded ps2.zip

That "Hello again" is not repeating, it only shows once in the Serial Monitor even though the command is in the loop function.

Bump.

I'm not familiar with the library or it's use. It does seem quite "old"; perhaps it has undergone "bit rot."

try adding debugging to see which (if any) of the ps2 calls is "hanging."

  mouse.write(0xeb);  // give me data!
  Serial.println("Send data request")'
  mouse.read();      // ignore ack
  Serial.println("read ack");
  mstat = mouse.read();
  Serial.println("read mstat");
  mx = mouse.read();
  Serial.println("read mx");
  // etc

Why is the call to mouse_init() commented out? While my experience is mostly with PS2 keyboards, I'm looking at https://isdaman.com/alsos/hardware/mouse/ps2interface.htm and it says that you should only be getting 4-byte mouse messages IF you've explicitly enabled "intelimouse" mode (and it doesn't look like the mouse_init() is doing that, even if you did call it. So you're probably only getting three-byte updates.)