Keyboard can't enter bluetooth code when trying to pair
This morning my Apple keyboard from 2009 suddenly had some defect buttons (like the left cmd and the enter key), so I tried disconnecting it from the Bluetooth to reconnect it. When I tried pairing it again, I had to enter a Bluetooth code on the keyboard to complete the pairing proces (as can be seen on the image). However, my Mac didn't register any key presses. I've tried restarting the keyboard and my Mac without any luck.
So the keyboard can be found, however when I have to type the BlueTooth code as can be seen on the image, no keys are registered. I've tried many codes and none of the numbers are registered.
Any help is appreciated.
MacBook Pro 15″, macOS 11.1