Advertisement
Guest User

Untitled

a guest
Nov 27th, 2015
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. function startListeningKeyDownEvent(){
  2. $(window).keydown(function(e){
  3. // put the keycode pressed to console
  4. console.log(e.keyCode);
  5. // if it's Enter key, trigger click event on mic button
  6. if( e.keyCode + '' === '13' ){
  7. $('button[mic-id="all"]').trigger('click')
  8. }
  9. return false;
  10. });
  11. }
  12.  
  13. $(document).ready(()=>{ // or onDeviceReady for cordova
  14. startListeningKeyDownEvent();
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement