foolmoron

Members
  • Content Count

    2
  • Joined

  • Last visited

About foolmoron

  • Rank
    Newbie

Contact Methods

  • Website URL
    http://foolmoron.io
  • Twitter
    foolmoron

Profile Information

  • Gender
    Not Telling
  1. Submitted my dating sim game to the site for approval! http://foolmoron.itch.io/kawaii-aishiteru-wormhole-adventure Source: https://github.com/foolmoron/Kawaii-Wormhole-Adventure
  2. Keep in mind that in Firefox, you don't get the pressed key with event.keyCode, but with event.which. So if you want portability, you need to do: var key = event.keyCode || event.which;Further, if you're trying to get which characters are actually typed by the player, with the right capitalization, then you should use the keypress event instead of the keydown event. Keypress doesn't fire when non-ASCII keys like Shift or F2 are pressed, only when an actual character is input. It does fire on enter/return, though (keycode 13). For example: //When pressing A, this event logs 'a'//When pressing Shift + A, this event logs 'A'window.addEventListener('keypress', function(event) { var key = event.keyCode || event.which; console.log("keypress = " + String.fromCharCode(key));});//When pressing A, this event logs 'A'//When pressing Shift + A, this event logs '' and 'A'window.addEventListener('keydown', function(event) { var key = event.keyCode || event.which; console.log("keydown = " + String.fromCharCode(key));});