Replaced the triggering mechanism for a key in ShouldMoveAvatar

JavaScript mechnanism works more reliably on Linux.