Fixed custom mouse cursor issues.

Optomised input by only iterating through present entries, rather than
entire map.