javascript - get keycode with shiftkey -


i want keycode if pressed shift key,

for ex. press , b.
want store in 1 array [shiftkey,65,66] please suggest me if possible or going wrong.

you can try sanjay:

<input id="down" type="text"/>   var your_array = [];  document.onkeydown = function (e) {   var keypress;    if (typeof event !== 'undefined') {     keypress = this.value + string.fromcharcode(e.keycode);   }   else if (e) {     keypress = e.which;   }     if(keypress == '16'){     keypress = 'shift';     }   your_array.push(keypress);  alert(your_array);     // returns [shift,65,66];   return false;   // prevents default action }; 

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -