How to create custom keyboard shortcuts for google app script functions?

后端 未结 9 1605
灰色年华
灰色年华 2020-12-04 12:10

I\'m trying to get a sense of the viability of replacing some of my Microsoft Excel spreadsheets with Google Doc Spreadsheets. How can I create a custom keyboard shortcut t

9条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-04 12:41

    A solution has been posted over at issue 306! For the lazy, here it is:

    The new IFRAME mode in HtmlService does allow for key codes to be passed on to Add-ons...

    $(document).keydown(function(e){
      //CTRL + V keydown combo
      if(e.ctrlKey && e.keyCode == 86){
        $( '#output' ).html("I've been pressed!");
      }
    })
    

    Have to click on / activate the sidebar first for that to happen.

提交回复
热议问题