阅读:2248回复:6
keyconfig 鼠标左键的求助!
能否有这样的功能:用键盘上的任意一个字母键来代替鼠标左键的点击。
这样的话可以使得鼠标移动到任意链接上不用鼠标左键点击来打开网页上的链接,而用键盘上的字母键来点击,这样可以减缓右手的僵硬。。。。 我也知道WINDOWS的轻松访问用小键盘来代替鼠标键,但是小键盘上的键我在keyconfig已经分配完了,轻松访问不能设置成左边的字母键来代替。 找了好久都没有这样的代码,哪位能人能够帮助,谢谢啊!! |
|
1楼#
发布于:2016-07-05 14:23
keys['t'] = function(){if(XULBrowserWindow.overLink) gBrowser.addTab(XULBrowserWindow.overLink);}; //在新标签页打开链接(后台)
keys['t'] = function(){if(XULBrowserWindow.overLink) gBrowser.selectedTab = gBrowser.addTab(XULBrowserWindow.overLink);}; //在新标签页打开链接(前台) 二选一,t可以换成其它字母 |
|
2楼#
发布于:2016-07-05 16:52
keyconfig从启ff的代码是什么?
我之前的不起作用了。 |
|
3楼#
发布于:2016-07-05 18:04
好主意, 我也是因为太经常点鼠标导致右手酸痛, 最近換了键盘操作
这样左手操作链接的比率大大提高了 |
|
4楼#
发布于:2016-07-05 19:20
hill:keyconfig从启ff的代码是什么?我 VimFx 在用的代码,试试看 let cancelQuit = Cc["@mozilla.org/supports-PRBool;1"]. createInstance(Ci.nsISupportsPRBool); Services.obs.notifyObservers(cancelQuit, "quit-application-requested", "restart"); if (cancelQuit.data) return; let appStartup = Cc["@mozilla.org/toolkit/app-startup;1"]. getService(Ci.nsIAppStartup); appStartup.quit(Ci.nsIAppStartup.eAttemptQuit | Ci.nsIAppStartup.eRestart); |
|
5楼#
发布于:2016-07-06 10:33
|
|
6楼#
发布于:2016-07-08 13:56
hill:keyconfig从启ff的代码是什么?const nsIAppStartup = Components.interfaces.nsIAppStartup; // Notify all windows that an application quit has been requested. var os = Components.classes["@mozilla.org/observer-service;1"] .getService(Components.interfaces.nsIObserverService); var cancelQuit = Components.classes["@mozilla.org/supports-PRBool;1"] .createInstance(Components.interfaces.nsISupportsPRBool); os.notifyObservers(cancelQuit, "quit-application-requested", null); // Something aborted the quit process. if (cancelQuit.data) return; // Notify all windows that an application quit has been granted. os.notifyObservers(null, "quit-application-granted", null); // Enumerate all windows and call shutdown handlers var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"] .getService(Components.interfaces.nsIWindowMediator); var windows = wm.getEnumerator(null); while (windows.hasMoreElements()) { var win = windows.getNext(); if (("tryToClose" in win) && !win.tryToClose()) return; } Components.classes["@mozilla.org/toolkit/app-startup;1"].getService(nsIAppStartup) .quit(nsIAppStartup.eRestart | nsIAppStartup.eAttemptQuit); |
|