keyconfig 20110522

Announce and Discuss the Latest Theme and Extension Releases.
Post Reply
Amsuke
Posts: 60
Joined: April 3rd, 2010, 8:23 am

Re: keyconfig 20110522

Post by Amsuke »

Forgive me for reposting, but I think my last attempt may have slipped through the cracks.

I had previously been using code that would duplicate the current window:


Code: Select all

OpenBrowserWindow().addEventListener("load", function tempFunction(event){
this.removeEventListener("command", tempFunction, true);
var ss = Components.classes["@mozilla.org/browser/sessionstore;1"].getService(Components.interfaces.nsISessionStore);
ss.setTabState(this.gBrowser.mCurrentTab, ss.getTabState(gBrowser.mCurrentTab))
},true);



However, after updating Firefox (now v31), this no longer works.

How does this need to be adjusted to work again?
kennerr
Posts: 93
Joined: May 14th, 2014, 12:55 pm

Re: keyconfig 20110522

Post by kennerr »

Hi there,

Can anyone please tell me how I can reset ALL keyboard shortcuts back to default?

Just uninstalling keyconfig did not reset any custom added or modified keyboard shortcuts.

Thanks!
marty60
Posts: 475
Joined: March 21st, 2012, 7:09 am

Re: keyconfig 20110522

Post by marty60 »

kennerr wrote:Hi there,

Can anyone please tell me how I can reset ALL keyboard shortcuts back to default?

Just uninstalling keyconfig did not reset any custom added or modified keyboard shortcuts.

Thanks!


If you know the shortcuts you can use keyconfig options to reset each one. That removes custom keys or changes remapped shortcuts back to default.

Another quicker option if you're comfortable working with prefs.js is to go to about:config and type in "keyconfig" without the quotes and you'll see the list of shortcuts in bold. You can right click to reset each one then restart.

You'll notice that when uninstalling keyconfig it does not delete those about:config entries and why doing so does not make a difference. They need to be removed manually.
kennerr
Posts: 93
Joined: May 14th, 2014, 12:55 pm

Re: keyconfig 20110522

Post by kennerr »

@marty60,

Many thanks! I will follow the about:config route then.
kennerr
Posts: 93
Joined: May 14th, 2014, 12:55 pm

Re: keyconfig 20110522

Post by kennerr »

Does someone know what code can be used in keyconfig to archive an entire thread and not just a single selected message?
firefoxuse
Posts: 1086
Joined: November 8th, 2011, 12:06 pm

Re: keyconfig 20110522

Post by firefoxuse »

can anyone tell me how to make RCtrl to close the current tab?

thanks!
rucarden
New Member
Posts: 1
Joined: December 19th, 2014, 7:43 am

Re: keyconfig 20110522

Post by rucarden »

I use the win/os key in most of my other applications. I dislike having to edit the pref.js directly to get it to work in firefox and thunderbird. I usually screw something up. So I finally made the effort and looked at how to add support for using the win/osKey in keyconfig.
It was suprisingly easy to figure out without the help of the alert function and the error console. The hardest part was the keycode and the use of getModifierState.
Based on the keycodes listed at
https://developer.mozilla.org/en-US/doc ... nt.keyCode
this should work on Windows and Unix.
The only file I changed is in keyconfig.xpi/keyconfig.zip/content/keyconfig.js
Or
The diff is

Code: Select all

--- keyconfig.js.orig   2014-12-19 09:30:34.202091007 -0500
+++ keyconfig.js.new   2014-12-19 09:39:03.544662036 -0500
@@ -32,10 +32,14 @@
  gPlatformKeys.alt   = platformKeys.getString("VK_ALT");
  gPlatformKeys.ctrl  = platformKeys.getString("VK_CONTROL");
  gPlatformKeys.sep   = platformKeys.getString("MODIFIER_SEPARATOR");
+ gPlatformKeys.win   = platformKeys.getString("VK_WIN");
+
+
  switch (gPrefService.getIntPref("ui.key.accelKey")){
   case 17:  gPlatformKeys.accel = gPlatformKeys.ctrl; break;
   case 18:  gPlatformKeys.accel = gPlatformKeys.alt; break;
   case 224: gPlatformKeys.accel = gPlatformKeys.meta; break;
+  case 91: gPlatformKeys.accel = gPlatformKeys.win; break;
   default:  gPlatformKeys.accel = (window.navigator.platform.search("Mac") == 0 ? gPlatformKeys.meta : gPlatformKeys.ctrl);
  }
 
@@ -102,7 +106,7 @@
 function onOK() { }
 
 function getFormattedKey(modifiers,key,keycode) {
- if(modifiers == "shift,alt,control,accel" && keycode == "VK_SCROLL_LOCK") return gStrings.disabled;
+ if(modifiers == "shift,alt,control,accel,os" && keycode == "VK_SCROLL_LOCK") return gStrings.disabled;
  if(!key && !keycode) return gStrings.disabled;
 
  var val = "";
@@ -112,6 +116,7 @@
   .replace("shift",gPlatformKeys.shift)
   .replace("control",gPlatformKeys.ctrl)
   .replace("meta",gPlatformKeys.meta)
+  .replace("os",gPlatformKeys.win)
   .replace("accel",gPlatformKeys.accel)
   +gPlatformKeys.sep;
  if(key == " ") {
@@ -179,13 +184,13 @@
  if(event.ctrlKey) modifiers.push("control");
  if(event.metaKey) modifiers.push("meta");
  if(event.shiftKey) modifiers.push("shift");
+ if(event.getModifierState("OS")) modifiers.push("os");
 
  modifiers = modifiers.join(" ");
 
  var key = null; var keycode = null;
  if(event.charCode) key = String.fromCharCode(event.charCode).toUpperCase();
  else { keycode = gVKNames[event.keyCode]; if(!keycode) return;}
-
  gEdit.value = getFormattedKey(modifiers,key,keycode);
  gEdit.keys = [modifiers,key,keycode];
firefoxuse
Posts: 1086
Joined: November 8th, 2011, 12:06 pm

Re: keyconfig 20110522

Post by firefoxuse »

are you replying to someone?

rucarden wrote:I use the win/os key in most of my other applications. I dislike having to edit the pref.js directly to get it to work in firefox and thunderbird. I usually screw something up. So I finally made the effort and looked at how to add support for using the win/osKey in keyconfig.
It was suprisingly easy to figure out without the help of the alert function and the error console. The hardest part was the keycode and the use of getModifierState.
Based on the keycodes listed at
https://developer.mozilla.org/en-US/doc ... nt.keyCode
this should work on Windows and Unix.
The only file I changed is in keyconfig.xpi/keyconfig.zip/content/keyconfig.js
Or
The diff is

Code: Select all

--- keyconfig.js.orig   2014-12-19 09:30:34.202091007 -0500
+++ keyconfig.js.new   2014-12-19 09:39:03.544662036 -0500
@@ -32,10 +32,14 @@
  gPlatformKeys.alt   = platformKeys.getString("VK_ALT");
  gPlatformKeys.ctrl  = platformKeys.getString("VK_CONTROL");
  gPlatformKeys.sep   = platformKeys.getString("MODIFIER_SEPARATOR");
+ gPlatformKeys.win   = platformKeys.getString("VK_WIN");
+
+
  switch (gPrefService.getIntPref("ui.key.accelKey")){
   case 17:  gPlatformKeys.accel = gPlatformKeys.ctrl; break;
   case 18:  gPlatformKeys.accel = gPlatformKeys.alt; break;
   case 224: gPlatformKeys.accel = gPlatformKeys.meta; break;
+  case 91: gPlatformKeys.accel = gPlatformKeys.win; break;
   default:  gPlatformKeys.accel = (window.navigator.platform.search("Mac") == 0 ? gPlatformKeys.meta : gPlatformKeys.ctrl);
  }
 
@@ -102,7 +106,7 @@
 function onOK() { }
 
 function getFormattedKey(modifiers,key,keycode) {
- if(modifiers == "shift,alt,control,accel" && keycode == "VK_SCROLL_LOCK") return gStrings.disabled;
+ if(modifiers == "shift,alt,control,accel,os" && keycode == "VK_SCROLL_LOCK") return gStrings.disabled;
  if(!key && !keycode) return gStrings.disabled;
 
  var val = "";
@@ -112,6 +116,7 @@
   .replace("shift",gPlatformKeys.shift)
   .replace("control",gPlatformKeys.ctrl)
   .replace("meta",gPlatformKeys.meta)
+  .replace("os",gPlatformKeys.win)
   .replace("accel",gPlatformKeys.accel)
   +gPlatformKeys.sep;
  if(key == " ") {
@@ -179,13 +184,13 @@
  if(event.ctrlKey) modifiers.push("control");
  if(event.metaKey) modifiers.push("meta");
  if(event.shiftKey) modifiers.push("shift");
+ if(event.getModifierState("OS")) modifiers.push("os");
 
  modifiers = modifiers.join(" ");
 
  var key = null; var keycode = null;
  if(event.charCode) key = String.fromCharCode(event.charCode).toUpperCase();
  else { keycode = gVKNames[event.keyCode]; if(!keycode) return;}
-
  gEdit.value = getFormattedKey(modifiers,key,keycode);
  gEdit.keys = [modifiers,key,keycode];
kulmegil
Posts: 64
Joined: February 16th, 2005, 12:46 pm

Re: keyconfig 20110522

Post by kulmegil »

I would like a command that cycles between pinned tabs and last selected not-pinned tab.
Can someone help me?

* if selected tab is not pinned switch to first pinned tab
* if selected tab is pinned switch to next pinned tab
* if last pinned tab is selected switch to last tab I had selected that was not pinned
(just in case - sorry for my english)
ar11x
Posts: 90
Joined: January 6th, 2015, 4:45 am

Re: keyconfig 20110522

Post by ar11x »

Can someone help me to focus a textarea by using keyconfig ?

Follow is my code :

Code: Select all

if (gBrowser.getBrowserForTab(gBrowser.tabContainer.childNodes[a]).contentTitle == 'Google Translate')
{
   gBrowser.selectTabAtIndex(a, event);
   document.getElementById("source").focus();
   return;
}


They did not work at all.
Please help me !
User avatar
tonymec
Posts: 734
Joined: October 15th, 2004, 2:58 am
Location: Ixelles (Brussels Capital Region, Belgium)
Contact:

Re: keyconfig 20110522

Post by tonymec »

There is a rumor that (I don't know exactly when) all add-ons will have to be signed, uploaded to AMO and reviewed by AMO editors including extensions not hosted at AMO, otherwise they'll be disabled by the add-ons manager. Dorando, if this rumour is true it will doubtlessly affect keyconfig. I've been told the matter is being discussed at mozilla.addons.user-experience (a list I don't follow). Any thoughts?
Best regards,
Tony
rejlan givens
Posts: 11
Joined: December 9th, 2014, 1:35 am

Re: keyconfig 20110522

Post by rejlan givens »

Hi everyone,

The functions for closing all tabs, left tabs and right tabs do not work without the TabMix add-on installed:

gBrowser.closeLeftTabs(gBrowser.mCurrentTab);
gBrowser.closeRightTabs(gBrowser.mCurrentTab);
gBrowser.closeAllTabs();

I wonder if it is possible for these to work without having to instal TabMix or any other additional add-on? Or is it possible to make at least "Close other tabs" and "Close tabs to the right" from the Firefox tab context menu work without installing TabMix?

Thank you for the help.
nigelle
Posts: 117
Joined: June 9th, 2005, 8:30 am
Location: France

Re: keyconfig 20110522

Post by nigelle »

The release notes for the release 36.0 of Firefox are available at http://www.mozilla.org/en-US/firefox/notes. They announce : "Changed Add-on Compatibility".
How is Keyconfig affected by this ? Do we have to wait for a new release of Keyconfig before updating Firefox ?
chirpy_7
Posts: 165
Joined: March 19th, 2007, 6:24 am

Re: keyconfig 20110522

Post by chirpy_7 »

hi dorando & co,

(and @nigelle)

Code: Select all

if(window.content.location.href.match(/^http(s)?:\/\/www\.google.(com|fr)\/search/))
{
var nodes = content.document.evaluate('//h3[@class]/a', content.document, null, 7, null);
gBrowser.addTab(nodes.snapshotItem(0));
}


and

Code: Select all

if(window.content.location.href.match(/^http(s)?:\/\/www\.google.(com|fr)\/search/))
{
var nodes = content.document.evaluate('//h3[@class]/a', content.document, null, 7, null);
gBrowser.loadURI(nodes.snapshotItem(0));
}


stopped working in FF.36 (it seems).

This error *might* be related:

Code: Select all

TypeError: aURI.toLowerCase is not a function


How to fix?

Thank you.
User avatar
RealRaven2000
Posts: 4
Joined: August 7th, 2014, 1:07 am

Re: keyconfig 20110522

Post by RealRaven2000 »

can somebody post the repository link for the latest source code?

tx
Post Reply