Hi Charkel,
Thank you for participating in the Apple Support Communities.
If you're using an Apple wireless keyboard and it isn't recognized by your iMac, start with these tips to verify that the keyboard is powering on and whether or not it is paired with the Mac:
- Push and release the On/Off switch to turn on the Apple Wireless Keyboard.
- When your keyboard is on and paired, and the batteries are charged, the light will glow steadily for several seconds, then turn off.
- If your wireless keyboard isn’t paired with your Mac, the indicator light will begin to blink. This indicates your keyboard is in discovery mode and ready to pair with your Mac.
- If the LED doesn't light up, remove the batteries to make sure they're good and that they're installed correctly.
From:
Troubleshooting wireless mouse and keyboard issues - Apple Support
If the keyboard seems to be powering on normally, try resetting the System Management Controller (SMC) on your iMac using the steps from this article:
Intel-based Macs: Resetting the System Management Controller (SMC) - Apple Support
All the best,
Jeremy