搜狗云输入法已经出来了一段时间,一开始就觉得是个累赘,现在也觉得是。
刚从Wopus上看到把搜狗云输入法放到博客里面的方法,效果还不错。不过这也只适合YY,实用性不强。
Wopus中的方法只支持IE内核的浏览器,Firefox下就不行了,自己改了改,也能在Firefox下运行。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| function sogou(e) { e = window.event || e; if (e.ctrlKey && e.shiftKey && e.keyCode == 81) { var n = navigator.userAgent.toLowerCase(); ie = n.indexOf('msie') != -1 ? 1: 0; if (document.documentMode) ie = 0; charset = ''; if (ie) charset = document.charset; src = ie && charset == 'utf-8' ? 'http://web.pinyin.sogou.com/web_ime/init2_utf8.php': 'http://web.pinyin.sogou.com/web_ime/init2.php'; element = document.createElement('script'); element.setAttribute('src', src); document.body.appendChild(element) } } document.onkeydown = sogou;
|
把这段JS代码附加到主题下的JS文件中,如果没有的话可以自己建立一个,当然你也可以直接写到php文件里。
上述的默认快捷键是 Ctrl+Shift+Q ,需要修改的话把第三行的 if 判断条件中的键值修改就可以了。