How to detect CTRL + V in javascript with cyrillic?

I detect ctrl+vin the keydown event like this:

.keydown(function(e){
   if ( e.ctrlKey && e.keyCode == 86 ) {
      console.log ('ctrl+v!');
   }
});

It works great when my layout is Latin (English). But when I switch my layout to Russian (Cyrillic) - it is executed ctrl+v(the text is inserted), but jQuery detection does not work. ( e.keyCode = 0Cyrillic characters).

PS I need it in good condition (to format the inserted text)

PPS My task was completed without detecting an insert. (just listening to the keyup event was enough for me), but the problem exists on my PC (Ubuntu, Fx6). The keyCode of the Cyrillic characters is recognized as 0, and you cannot detect shortcuts with Latin letters ( ctrl+c, ctrl+vetc.).

+5
source share
1 answer

This works for ubuntu (FF 5):

.keypress(function(e){
    if ( e.ctrlKey && (e.which == 86 || e.which==118) ) {
      console.log ('ctrl+v!');
   }
});

for using ctrl + n

 if ( e.ctrlKey && (e.which == 110 || e.which==78) ) 

and for ctrl + t:

if ( e.ctrlKey && (e.which == 84 || e.which==116) )
+5
source

All Articles