SUNbrightness / 百度翻译快捷键发音

// ==UserScript==
// @name         百度翻译快捷键发音
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  百度翻译快捷键发音esc 快捷键聚焦文本框shift+a、shift+s
// @author       SUNSHINE
// @match        https://fanyi.baidu.com/*
// @grant        none
// @icon         https://www.baidu.com/favicon.ico
// @license MIT
// @copyright 2020, SUNbrightness (https://openuserjs.org/users/SUNbrightness)
// ==/UserScript==

(function() {
    $(document).keyup(function (event){
        console.log(event);
        var metaKeyPressed = event.metaKey;
        var altKeyPressed = event.altKey;
        var shiftKey = event.shiftKey;

        if(shiftKey&&event.keyCode==65){
            $("#baidu_translate_input")[0].focus();
            $("#baidu_translate_input").val('');
        }
        if(shiftKey&&event.keyCode==83){
            $("#baidu_translate_input")[0].focus();
        }

        if (event.keyCode == 27 ) {
            $($(".operate-btn.op-sound.data-hover-tip")[0]).click();
        }
    });

})();