I wouldn't use rechargeable batteries for bluetooth.
In time these batteries loose their charge and drain rapidly.
The other batteries I would recommend are, believe it or not, Radio Shack batteries!
When I played in a band, these were recommended to me and they were the best lasting batteries ever.
As far as your BT connection make sure they are not located too far from the iMac; I'm assuming your setup is on a computer desk of sorts. Also, make sure there are no other BT connections around, this can interfere with their connections.
I had a BT keyboard that I used with my ipad, and every time I turned on the iMac, I noticed the wireless keyboard for the iMac didn't want to work. It took a while, but I realized the BT keyboard for the ipad wasn't allowing the keyboard for the iMac to connect.