keyconfig 20110522

Announce and Discuss the Latest Theme and Extension Releases.
Post Reply
andymandias
Posts: 2
Joined: July 24th, 2012, 2:57 pm

Re: keyconfig 20110522

Post by andymandias »

Philip Chee wrote:On the latest nightlies there is a separate token for the Win key. Event.osKey . In XUL in addition to the usual modifiers="alt ctrl shift meta" you can also use "os".

Bug 751749 - cannot configure keyboard shortcuts to use Meta modifier instead of Alt

Phil


Thank you! This is exactly what I needed.
nigelle
Posts: 117
Joined: June 9th, 2005, 8:30 am
Location: France

Re: keyconfig 20110522

Post by nigelle »

I have a standard (I have not modified it) Windows with keys labelled "shift", "ctrl", "alt" and the windows flag and "alt gr" that I think is equivalent to ctrl+alt.
Please clarify which of them I can use (press) with keyconfig to define shortcut according the version of FF that I use.
User avatar
Qwerky
Posts: 122
Joined: March 5th, 2005, 10:33 pm
Location: Adanac

Re: keyconfig 20110522

Post by Qwerky »

The codes to sort the thread pane:
MsgSortThreadPane(nsMsgViewSortType.byAccount);
MsgSortByDate()
MsgSortByRecipient()
MsgSortBySender()
MsgSortBySubject()
MsgSortByTags()
no longer work. Are there new codes?
Mr. Qwerky
User avatar
Qwerky
Posts: 122
Joined: March 5th, 2005, 10:33 pm
Location: Adanac

Re: keyconfig 20110522

Post by Qwerky »

The codes to select which messages to view in the thread pane:
ViewChangeByValue("0");
where the "value" is:
0 for all messages,
9 for new messages,
1 for unread messages,
16 for read messages,
etc. no longer work. Are there new codes?
Mr. Qwerky
morat
Posts: 6432
Joined: February 3rd, 2009, 6:29 pm

Re: keyconfig 20110522

Post by morat »

@Qwerky

MXR Search:

http://mxr.mozilla.org/comm-release/sea ... ng=MsgSort
http://mxr.mozilla.org/comm-release/sea ... ewSortType

Code: Select all

MsgSortThreadPane("byDate");
MsgSortThreadPane("byRecipient");

Code: Select all

// show properties in DOM Inspector
inspectObject(nsMsgViewSortType);

Forum Search:

http://www.google.com/search?q=ViewChan ... lazine.org

dorando wrote:ViewChangeByValue has been replaced by ViewChange

viewtopic.php?p=10151465#p10151465

Code: Select all

// Toggle Mail Views
var customView = "Last 5 Days";
if (document.getElementById("viewPicker").label == customView) {
  if ("ViewChangeByValue" in window) ViewChangeByValue(0);
  else ViewChange(0);
} else {
  for (var i = 0; i < gMailViewList.mailViewCount; i++) {
    var viewInfo = gMailViewList.getMailViewAt(i);
    if (viewInfo.prettyName == customView) {
      if ("ViewChangeByValue" in window) ViewChangeByValue(kViewItemFirstCustom + i);
      else ViewChange(kViewItemFirstCustom + i);
      break;
    }
  }
}
User avatar
Qwerky
Posts: 122
Joined: March 5th, 2005, 10:33 pm
Location: Adanac

Re: keyconfig 20110522

Post by Qwerky »

morat, thank you! I spent more than an hour searching before posting, but obviously I didn't have the correct search terms! All of the message views and sort orders are now working once again.

In your first link (in the previous message) is a list of the available sort orders; it includes sortascending and sortdescending, sortthreaded and sortunthreaded. I have a key that uses the command MsgToggleThreaded(); to toggle between threaded and unthreaded views. Is there a similar command to toggle between ascending and descending sort order? [I tried searching the mxr links for various terms, but didn't find it.]
Mr. Qwerky
morat
Posts: 6432
Joined: February 3rd, 2009, 6:29 pm

Re: keyconfig 20110522

Post by morat »

@Qwerky

MsgSortAscending() is the same as gFolderDisplay.view.sortAscending().

A search for gFolderDisplay.view.sortAscending() in threadPane.js leads to MsgReverseSortThreadPane().

http://mxr.mozilla.org/comm-release/sou ... eadPane.js

Code: Select all

MsgReverseSortThreadPane();

BTW,

Thunderbird folder is http://mxr.mozilla.org/comm-release/source/mail/.
SeaMonkey folder is http://mxr.mozilla.org/comm-release/source/suite/.

I believe ViewChangeByValue is still valid for SeaMonkey.

http://mxr.mozilla.org/comm-release/sea ... ngeByValue
Amsuke
Posts: 60
Joined: April 3rd, 2010, 8:23 am

Re: keyconfig 20110522

Post by Amsuke »

Dorando, you once helped me to create a "Duplicate Window" command using the following code:

Code: Select all

var tab = gBrowser.duplicateTab(gBrowser.mCurrentTab);
tab.hidden = true;
gBrowser.replaceTabWithWindow(tab);



The problem is that with the current versions of Firefox, this is no longer working properly. It opens a new window with the correct URL in the address bar - but it never loads the page. I have to put the focus in the address bar and hit enter to actually load the page.

Can this be fixed?
morat
Posts: 6432
Joined: February 3rd, 2009, 6:29 pm

Re: keyconfig 20110522

Post by morat »

@chirpy_7

Reference: viewtopic.php?p=12058379#p12058379

I got the following code snippets to work correctly with the following setup.

Code: Select all

function openTabContextPopup(tab) {
  document.getElementById("tabContextMenu").openPopup(
    tab, "after_start", 0, 0, true, false, {target: tab});
}
openTabContextPopup(gBrowser.mCurrentTab);

Code: Select all

loadURI(content.location.href + "&lr=lang_fr");

Keyconfig 20110522
Tab Mix Plus 0.4.0.3
Firefox Portable 14.0.1
Windows XP SP3

Edit:

The first question was already answered by dorando.

viewtopic.php?p=11948465#p11948465
viewtopic.php?p=11987681#p11987681
viewtopic.php?p=12058379#p12058379

:roll:
Last edited by morat on August 13th, 2012, 3:05 am, edited 3 times in total.
chirpy_7
Posts: 165
Joined: March 19th, 2007, 6:24 am

Re: keyconfig 20110522

Post by chirpy_7 »

hi morat,

thx for your help. good to know that it works for you (already)!

I tried both (even just came back from a restart (which normally isn't required)) - unfortunately though: neither of your suggestions works on my machine just yet. (I doubt that being on Linux makes the difference)

Regarding your first code: do I just need to copy & paste it "as is" - or does the function require a separate key etc ?

I also tried dorando's suggestion @ viewtopic.php?p=11987681#p11987681 which I had overlooked previously: but also this didn't want to work...

:-(

Further help much appreciated,

chirpy

EDIT

Afterthought: I've got the latest version of NoScript installed. Any chance it started interfering?

EDIT 2

http://forums.informaction.com/viewtopi ... 36&p=29533

al_9x wrote:I suspect (will check) that in order to make this work, loadURIWithFlags will need to be patched (instead of loadURI)

Indeed, loadURIWithFlags is called in 6.0+, loadURI in 5.0.


No idea if that's relevant / helpful.

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

Re: keyconfig 20110522

Post by dorando »

mark_jd wrote:I want to assign F1 key to open the google page in a new foreground tab.
Try

Code: Select all

gBrowser.selectedTab gBrowser.addTab("http://www.google.com/"); 

ildar.mulyukov wrote:[thunderbird]
plz gimme a hint, what to put into "Action" to do "Repair Folder" . This is usually done trough the Folder Properties.
Try

Code: Select all

var tempEditFolder;

eval(
"tempEditFolder ="gFolderTreeController.editFolder.toString().replace(
/
let /g,
"var "
).replace(
"if (folder.isServer) {",
"rebuildSummary(folder); return; if (folder.isServer) {"
));

tempEditFolder(); 

K4RBQT99 wrote:After each Firefox update, I see that the native shorcut "Find Next" (F3) is re-enabled. I have this disabled for to free F3 for other custom action, so after the update my action doesn't work anymore. A little nuisance, easy of to fix each time, but maybe somebody can to comment something related.
That <key> doesn't have an id so keyconfig generates one for it, sadly I had chosen a bad algorithm which would change the id if the amount of preceding <key>s changes. You could try to edit Profile/extensions/keyconfig@dorando.xpi (.xpi is the same as .zip) /components/keyconfig-service.js and replace

Code: Select all

  for(0nodes.lengthli++) if(!nodes[i].id)
   
nodes[i].id "xxx_key"+"_"+nodes[i].getAttribute("command")+nodes[i].getAttribute("oncommand"); 
with

Code: Select all

  for(0nodes.lengthli++) {
   var 
node nodes[i];
   if(!
node.hasAttribute("id")) {
    var 
1;
    do {
     var 
id "xxx_key"+(j++)+"_"+(node.getAttribute("command") || node.getAttribute("oncommand"));
    } while(
this.document.getElementById(id));
    
node.id id;
   }
  } 
which I'll likely use in the next update.

rahul wrote:firefox 13 broke some (but not all) of my Option key shortcuts, probably due to bug 418091. i got them working again by changing the symbols back to letters in prefs.js.
Hmm… if you try to assign those with keyconfig in Firefox 13+, are they correctly set or do you still need to the edit prefs.js?

mad.engineer wrote:TB 13.0.1, OS X 10.7.4, Using:

menuitem#keyconfig { display:none !important; }

in my userChrome.css, but it does not work. I can still see the keyconfig menu option via Tools->Keyconfig.
On mac, Firefox seems to use the native menu system and hides the XUL menu by setting display:none. Setting the hidden (or collapsed) attribute seems to exclude/remove an item from the native menu, so try (needs only be run once, should be remembered cross session):

Code: Select all

document.getElementById("keyconfig").setAttribute("hidden","true");
document.persist("keyconfig","hidden"); 

chirpy_7 wrote:to trigger language-specific search results in google, this used to work, but may have stopped with FF 13 (in any case: very recently):

Code: Select all

loadURI(window.content.location.href+"&lr=lang_fr");
Seems to work fine for me on google.com and google.fr.
chirpy_7 wrote:Moreover, I'd really appreciate a quick hint as to how you would go about uncovering what's causing these problems.
If errors are reported, a source, bug, or web search for the reported object/function can help, otherwise trying different parameters for the used functions or looking up how they are used in the source.

Labutin wrote:Why goDoCommand("cmd_compactFolder") compact ALL folders instead compact only selected folder?
Because of bug 64751. For only compacting the selected folder try

Code: Select all

goDoCommand("button_compact"); 

taglife wrote:Thunderbird try
name: 附加元件, id: xxx_key1_é??å??å??ä?¶, shortcut: Ctrl+Shift+A, code:
BrowserOpenAddonsMgr();

Ineffective?
BrowserOpenAddonsMgr is only available in Firefox, try

Code: Select all

openAddonsMgr(); 

fogler1 wrote:how do I create a align to right key shortcut?
Try

Code: Select all

var controller document.commandDispatcher.getControllerForCommand("cmd_align");
if (
controller instanceof Components.interfaces.nsICommandController) {
 var 
params Components.classes["@mozilla.org/embedcomp/command-params;1"].createInstance(Components.interfaces.nsICommandParams);
 
params.setStringValue("state_attribute""right");
 
controller.doCommandWithParams("cmd_align"params);

trianglekitty wrote:I'd like to assign the sequence ctrl+shift+end (highlight text to end of page under the cursor's position) to a single keyboard key like PgUp (which I never use.) Is this possible with keyconfig?
If a text box has the focus, shortcuts such as those are handled before they reach a XUL <key>, so keyconfig can't help here (since keyconfig only allows creation/modification of XUL <key>s).

But it is possible to override the file used by the backend code, so you could try to built an extension doing that by opening your Profile and create within the extensions folder a folder named userxul@nobody containing:

install.rdf

Code: Select all

<?xml version="1.0"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.mozilla.org/2004/em-rdf#">

  <rdf:Description rdf:about="urn:mozilla:install-manifest">
    <id>userxul@nobody</id>
    <name>User XUL</name>
    <version>0</version>

    <targetApplication><rdf:Description>
      <id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</id>
      <minVersion>1.0+</minVersion>
      <maxVersion>*</maxVersion>
    </rdf:Description></targetApplication>

  </rdf:Description>
</rdf:RDF>
chrome.manifest

Code: Select all

content userxul .
override chrome://global/content/platformHTMLBindings.xml chrome://userxul/content/platformHTMLBindings.xml
(note that the files should not contain any space at the start).

Also open chrome://global/content/platformHTMLBindings.xml in Firefox and save that file (File > Save Page As…) in the userxul@nobody folder, open it, and remove any

Code: Select all

      <handler event="keypress" keycode="VK_PAGE_UP" command="cmd_movePageUp"/> 
and replace any

Code: Select all

      <handler event="keypress" keycode="VK_END" modifiers="shift,control" command="cmd_selectBottom"/> 
with

Code: Select all

      <handler event="keypress" keycode="VK_PAGE_UP" command="cmd_selectBottom"/> 

Slickone wrote:I'm not sure what you mean about "add new shortcuts duplicating the functionality of the unsupported shortcuts"
Add a new key with the code of the unsupported shortcuts.
Slickone wrote:, or why I would want to do that.
To assign a different shortcut.
Slickone wrote:I can't imagine what kind of extension would add the Ctrl-Q shortcut. Any ideas?
No, but you could try to disable all Extensions, and re-enable them one by one.

ruffsense wrote:Where does keyconfig saves his config?
The configuration is saved by the Application in its prefs.js file.

nigelle wrote:I have a standard (I have not modified it) Windows with keys labelled "shift", "ctrl", "alt" and the windows flag and "alt gr" that I think is equivalent to ctrl+alt.
Please clarify which of them I can use (press) with keyconfig to define shortcut according the version of FF that I use.
"shift", "ctrl", and "alt". "alt gr" is equivalent to Alt+Ctrl.

Amsuke wrote:Dorando, you once helped me to create a "Duplicate Window" command […] The problem is that with the current versions of Firefox, this is no longer working properly. It opens a new window with the correct URL in the address bar - but it never loads the page. I have to put the focus in the address bar and hit enter to actually load the page.
That happens because of "Don’t load tabs until selected" (also causes bug 629232). Try

Code: Select all

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

chirpy_7 wrote:I tried both (even just came back from a restart (which normally isn't required)) - unfortunately though: neither of your suggestions works on my machine just yet. (I doubt that being on Linux makes the difference)

Regarding your first code: do I just need to copy & paste it "as is" - or does the function require a separate key etc ?

I also tried dorando's suggestion @ viewtopic.php?p=11987681#p11987681 which I had overlooked previously: but also this didn't want to work...
Works fine for me.
Support mozilla.dorando.at through donations/contributions.
Amsuke
Posts: 60
Joined: April 3rd, 2010, 8:23 am

Re: keyconfig 20110522

Post by Amsuke »

Dorando, your solution worked perfectly, as always. Thanks! :)
rahul
Posts: 25
Joined: January 25th, 2006, 12:00 pm
Location: the tealest city
Contact:

Re: keyconfig 20110522

Post by rahul »

rahul wrote:firefox 13 broke some (but not all) of my Option key shortcuts, probably due to bug 418091. i got them working again by changing the symbols back to letters in prefs.js.

Hmm… if you try to assign those with keyconfig in Firefox 13+, are they correctly set or do you still need to the edit prefs.js?


the keyconfig UI still uses the symbols, so Opt-Cmd-Z appears as ⌥⌘Ω (since Opt-Z produces the omega symbol). i had to change the Ω to a Z in prefs.js to get the shortcut working again.

what i haven't figured out is why it only affects *some* of my option-key shorcuts, but i'm guessing other mac users will run into this problem too. anyway, i figured bug 418091 would necessitate changing the symbols back to letters at some point.
kit kat
Posts: 16
Joined: May 26th, 2010, 6:25 pm

Re: keyconfig 20110522

Post by kit kat »

Is there a way to switch the dTa! Selector button on and off in what shortcut?? ): Thank you
/has too many questions.
Cleverson
Posts: 16
Joined: March 11th, 2009, 3:09 pm

Seamonkey: Open item in a new tab

Post by Cleverson »

Dear, I've just migrated to Seamonkey. When reading RSS feeds, pressing Enter on a feed item opens it on a new window. I'd like Enter to open it in a new tab so it doesn't load the entire page. Currently, to open in a new tab I have to right click and choose that option.

Thanks,
Post Reply