Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. var name = '';
  2.  
  3. // get the name by dereferencing 'e'
  4.  
  5. console.log('OnClick: ' + name );
  6.  
  7. }
  8.  
  9. $('#input').keydown( function( e ) {
  10.  
  11. var key = '';
  12.  
  13. // get the key by dereferencing 'e'
  14. // example:
  15. // key = e.originalEvent.srcElement.value;
  16.  
  17. console.log('OnKeydown: ');
  18.  
  19. }
  20.  
  21. // I have tried adding numerous Event listeners to the Global object (or local) w/o JQuery like this:
  22.  
  23. self.addEventListener("dispatchKeyEvent", function ( e ) {
  24. console.log('GLOBAL dispatchKeyEvent');
  25.  
  26. });
  27.  
  28. self.addEventListener("OnKeyListener ", function ( e ) {
  29. console.log('GLOBAL OnKeyListener ');
  30.  
  31. });
  32.  
  33. // ... just to see if it is sending other kinds of events that I am missing.
  34.  
  35. [Violation] 'setTimeout' handler took 65ms
  36. (index):866 OnClick
  37. (index):866 OnClick Key: undefined
  38. jquery-3.3.1.min.js:2
  39. [Violation] 'click' handler took 2416ms
  40. (index):866 OnKeydown
  41. (index):866 Key: C
  42. jquery-3.3.1.min.js:2
  43. [Violation] 'keydown' handler took 2738ms
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement