Event.keyCode always return 'undefined' in .on('input')

Event.keyCode always return 'undefined' in .on('input')

Hello guys,

I was wondering to create a ticket to report a bug, but I read that I need ask here first, so here I'm. I have a specific problem in the startup I'm working on that is solved by the following jQuery method:

  1. .on('input', function(){   });  

The 'input' event trigger every action inside an input or textarea (copy, paste, focus, keyup [I think]). The thing is: I didn't want an alternative to this method, I already solved my problem using a 'quick fix', I just want know why the following doesn't work or why this isn't implemented. 

I need get the keycode (or 'which') when this event is fired, but this doesn't work - always return undefined, no matter the circustances. Following is the code I'm using to test this:

  1. var input = jQuery("#post-input");

  2. input.on('input', function(event){
  3.     setTimeout(function(){
  4.         eventKeyCode = window.event ? event.keyCode : event.which;
  5.         console.log(eventKeyCode);
  6.     }, 200);
  7. });
You can also see my fiddle here.

Why this doesn't work / is implemente yet?