I've created such a system before. Even a little bit more advanced...
Easy if you have access to RtC. RtC (Reinventing the Craft) uses an edited Warcraft engine (not the default one, that wouldn't work) to detect mouse-and keyboard events.
It's not possible with the standard Warcraft and thus cannot be played on b.net (I do not know about LAN, all players must have the edited warcraft engine in either case though).
Unfortunately, RtC does not work with the latest JNGP (and Warcraft), thus you cannot create it anymore.