keyconfig 20110522

Announce and Discuss the Latest Theme and Extension Releases.
Post Reply
dorando
Posts: 1203
Joined: January 9th, 2004, 9:57 am
Contact:

Post by dorando »

redhonker wrote:Global: yes
Only needed if you want the shortcut available in every window, but that code wouldn't work in any non-browser window.

redhonker wrote:When I press F12, nothing happens
Anything in the Tools > Error Console (set javascript.options.showInConsole to true in <a href="http://kb.mozillazine.org/index.php?title=about:config&oldid=26276">about:config</a>)
redhonker
Posts: 172
Joined: October 26th, 2007, 11:45 am

Post by redhonker »

OK, found my mistake and it's working now.

Is there a function that close tab only?

Thanks!
dorando
Posts: 1203
Joined: January 9th, 2004, 9:57 am
Contact:

Post by dorando »

In reference to your other post, the simplest way seems to be

Code: Select all

if(gBrowser.mTabs.length == 1) gBrowser.addTab("about:blank");
BrowserCloseTabOrWindow();
redhonker
Posts: 172
Joined: October 26th, 2007, 11:45 am

Post by redhonker »

Thanks, it works great!
snakesmum
Posts: 9
Joined: January 12th, 2006, 2:33 pm
Location: Melbourne, Australia

Changing Shortcut

Post by snakesmum »

Hi Everyone,

Do you know if it's possible to use Keyconfig to alter the browsing shortcut
CTRL-Tab to CTRL-Shift with this progam?

I'm using Firefox 2.0.0.1.1 but the Keyconfig program seems to
be a bit older than that, and I'm not sure it will work.

Any ideas?

Thanks
Jean
dorando
Posts: 1203
Joined: January 9th, 2004, 9:57 am
Contact:

Re: Changing Shortcut

Post by dorando »

snakesmum wrote:Do you know if it's possible to use Keyconfig to alter the browsing shortcut
CTRL-Tab to CTRL-Shift with this progam?
Nope, Ctrl+Tab is defined by an eventListener and those can't be supported in a generic way, also Ctrl+Shift alone can't be used by the key handler.

Instead you can create a custom extensions to achieve that by using a blank (.xpi is a .zip) one and pasting following above the </overlay> in overlays/main.xul

Code: Select all

<script><![CDATA[
var ctrlShift = {
 init: function(){
  gBrowser.mTabBox.handleCtrlTab = false;
  window.addEventListener("keydown", ctrlShift._keyEventHandler, false);
 },
 _keyEventHandler: function(event){
  if(!event.isTrusted || event.altKey || event.metaKey) return;
  if(event.ctrlKey && event.shiftKey && event.keyCode == 16) {
   gBrowser.mTabContainer.advanceSelectedTab(1,true);

   event.stopPropagation();
   event.preventDefault();
  }
 }
}

window.addEventListener("load",ctrlShift.init,false);

]]></script>
Note because this would prevent you from using any Ctrl+Shift combinations I've added

Code: Select all

&& event.keyCode == 16
so that those can still work if you first press shift. Also note that if you want Ctrl+Tab to work in addition you can remove the

Code: Select all

gBrowser.mTabBox.handleCtrlTab = false;
line.
redhonker
Posts: 172
Joined: October 26th, 2007, 11:45 am

Post by redhonker »

What would be the CODE to go to previous tab and next tab? I want to map it to a function key instead of ctrl-page-down

Thanks!
snakesmum
Posts: 9
Joined: January 12th, 2006, 2:33 pm
Location: Melbourne, Australia

Post by snakesmum »

Thanks Dorando,

Have decided to leave it as it is, because it looks a little
difficult for this code challenged individual! :-)

Much appeciated anyway, and will pass it on to another
contact who also wants the info.

Cheers
Jean
kdd6
Posts: 7
Joined: February 7th, 2008, 6:44 pm

keyconfig 20060828.1 doesn't work in ff 2.0.0.12

Post by kdd6 »

i had started a new thread, but maybe this is the place to be for this.

keyconfig 20060828.1 worked up to ff 2.0.0.11. now it doesn't work in 2.0.0.12.

i had read that some changes could be made to the install.rdf and the jar file, etc. but in ff .11 the keyconfig folder was empty.

i found a "bumped" up version that was supposed to be up to ff version 3.0, but i got a 404 error when i clicked install.

will you be updating keyconfig any time soon?

thanks,
kdd6
dorando
Posts: 1203
Joined: January 9th, 2004, 9:57 am
Contact:

Post by dorando »

redhonker wrote:What would be the CODE to go to previous tab and next tab? I want to map it to a function key instead of ctrl-page-down

Thanks!
Previous Tab

Code: Select all

gBrowser.mTabContainer.advanceSelectedTab(-1,true);
Next Tab

Code: Select all

gBrowser.mTabContainer.advanceSelectedTab(1,true);
Note that without the

Code: Select all

,true
it won't wrap.

kdd6 wrote:keyconfig 20060828.1 worked up to ff 2.0.0.11. now it doesn't work in 2.0.0.12.
Compatibility information has been updated, you likely need to click on Tools > Add-ons > Find Updates (ignore the incorrect message at the top, only the one below the extension name is correct).

Note that it is possible to temporarily disable compatibility checking by adding a boolean 'extensions.checkCompatibility' through <a href="http://kb.mozillazine.org/index.php?title=about:config&oldid=26276">about:config</a>.
kdd6
Posts: 7
Joined: February 7th, 2008, 6:44 pm

Post by kdd6 »

thanks. it's nice to have it working again.
SleepyPrince
Posts: 4
Joined: August 11th, 2006, 10:54 am

Post by SleepyPrince »

I tried some codes for toggling findbar but they didn't work on Fx 3.0b3
Can somebody provide a new one?

edit: oh, nevermind, found it myself

Code: Select all

gFindBar.hidden ? gFindBar.onFindCommand() : gFindBar.close();
likebeingalone
Posts: 3
Joined: August 15th, 2006, 2:16 pm

Post by likebeingalone »

Is there a proper way/function to do key double-pressed? The following is my try:

Code: Select all

if (document.keypressed) {
  // reset
  document.keypressed=false;
  // code for double-pressed
} else {
  document.keypressed=true;
  function keysinglepressed() {
    if (document.keypressed) {
      // reset
      document.keypressed=false;     
      // code for single-pressed
    }
  }
  setTimeout(keysinglepressed, 600);
}

Thanks for any comment.
KRL
Posts: 148
Joined: September 26th, 2005, 5:00 pm
Contact:

Post by KRL »

Is there an update yet for Keyconfig for Thunderbird 2.0.0.12?

Thanks Dorando!
dorando
Posts: 1203
Joined: January 9th, 2004, 9:57 am
Contact:

Post by dorando »

Compatibility information has been updated, you likely need to click on Tools > Add-ons > Find Updates (ignore the incorrect message at the top, only the one below the extension name is correct).

Note that it is possible to disable compatibility checking by adding a boolean 'extensions.checkCompatibility' through <a href="http://kb.mozillazine.org/index.php?title=about:config&oldid=26276">about:config</a>.

likebeingalone wrote:Is there a proper way/function to do key double-pressed?
Not that I know of.
Support mozilla.dorando.at through donations/contributions.
Post Reply