I've Played WoW. Had my account hacked without anyone knowing my user name (I even had an authenticator on the account). Played others where people knew my account name yet I was never hacked. The difference? I used stronger passwords. To this day, the only account I have had hacked was WoW despiet all the extra security they put in.
BTW you get keyloggers by going to shady sites or downloading shady things. So yes it has everything to do with not going to shady sites and making strong passwords.