There a lots of complaints about the range of the keyboard if you search Google. A lot of them also say it's due to their computer being connected wirelessly, I tried it with ethernet but it didn't help because the router is still near by.
I'm pretty sure you can change the channel of your keyboard and mouse and even the routers to stop this happening.