Changeset 28151
- Timestamp:
- 01/08/09 06:59:37 (6 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/javascript/userscripts/pic2ch.key.control.user.js
r28150 r28151 1 1 // ==UserScript== 2 2 // @name pic2ch key control 3 // @namespace http://svn.coderepos.org/share/lang/javascript/userscripts/pic2ch.key control.user.js3 // @namespace http://svn.coderepos.org/share/lang/javascript/userscripts/pic2ch.key.control.user.js 4 4 // @description keyboard control for pic2ch 5 5 // @include http://pic2ch.giox.org/thread/* … … 18 18 var view = doc.defaultView; 19 19 var ev = doc.createEvent("MouseEvents"); 20 ev.initMouseEvent("click", true, true, view, 1, 1, 1, 0, 0, false, 0, false, false, 0, null);20 ev.initMouseEvent("click", true, true, view, 1, 1, 1, 0, 0, false, 0, false, false, 0, null); 21 21 elem.dispatchEvent(ev); 22 22 } 23 23 } 24 24 25 window.addEventListener("keypress", function(ev) {25 window.addEventListener("keypress", function(ev) { 26 26 var press = ev.which; 27 for(var i=0;i<KEY_SETTING.length;++i) {28 var [key, id] = KEY_SETTING[i];27 KEY_SETTING.forEach(function(setting) { 28 var [key, id] = setting; 29 29 if(press == key.charCodeAt(0)) { 30 30 click(id); 31 31 } 32 } 32 }); 33 33 }, false); 34 34
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)