keyconfig 20110522

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

Re: keyconfig 20080929

Post by dorando »

retepmu wrote:Meanwhile I could reproduce one cause for the effect.

When I delete the default key F8 for the command "Fensterlayout > Nachrichtenbereich" (Translation: Windowlayout > Messagearea), the effect takes place.
When I reset that command, the effect is gone.
Yep, that's an old issue I have yet to fix.

WCityMike wrote:Right now, I have Ctrl-B mapped to open focused on "BookmarksMenu" instead of "AllBookmarks".

I'd love for it to instead focus on the first folder named "[Folder Name]".
Try

Code: Select all

var myPlace = __ID__;

var wm = Cc["@mozilla.org/appshell/window-mediator;1"].getService(Ci.nsIWindowMediator);
var organizer = wm.getMostRecentWindow("Places:Organizer");

if (!organizer) {
 organizer = openDialog("chrome://browser/content/places/places.xul",
             "", "chrome,toolbar=yes,dialog=no,resizable", "myPlace");
 organizer.addEventListener("load", function(){
  organizer.removeEventListener(event.type, arguments.callee, true);
  organizer.PlacesUIUtils.leftPaneQueries["myPlace"] = myPlace;
 }, true);
}
 else {
 organizer.PlacesUIUtils.leftPaneQueries["myPlace"] = myPlace;
 organizer.PlacesOrganizer.selectLeftPaneQuery("myPlace");
 organizer.focus();
}
  
replace __ID__ with the result of

Code: Select all

function getFolderId(event) {
 if(!event.target.firstChild || !event.target.firstChild._resultNode || event.target.id == "bookmarksMenu")
  return;

 window.removeEventListener("mouseup", arguments.callee, true);
 event.preventDefault();
 event.stopPropagation();

 alert(event.target.firstChild._resultNode.itemId);
}

window.addEventListener("mouseup", getFolderId, true);  
(click on any folder in the main window)

retepmu wrote:I like to realize a shortcut to switch between these two options:

1 Tools > Options > Display > Advanced > [ ] use fixed width font for plain text messages
2 ... [x] use fixed width font for plain text messages
Try

Code: Select all

pref.setBoolPref("mail.fixed_width_messages", !pref.getBoolPref("mail.fixed_width_messages"));

ReloadMessage();  
retepmu wrote:If you like to give me hints how one could discover the appropriate code for commands in general (when TB does not offer a shortcut by default), I would appreciate that a lot.
DOM Inspector and Mozilla Cross-Reference.
WCityMike
Posts: 63
Joined: February 29th, 2004, 10:28 am
Location: Chicago, Illinois
Contact:

Re: keyconfig 20080929

Post by WCityMike »

Dorando, a real quick question: the "[Folder Name]" is the literal name of the folder (it's Mozilla's default name for a new folder), but it is always a different *actual* folder; it's whatever new folder I created to house my most recent set of bookmarks. I'm assuming that the folder's numerical ID would thus change. Is there still a way to do it based on focusing on the first occurrence of the name?
retepmu
Posts: 229
Joined: December 21st, 2002, 5:41 pm
Location: Berlin, Germany
Contact:

Re: keyconfig 20080929

Post by retepmu »

dorando wrote:
retepmu wrote:I like to realize a shortcut to switch between these two options:

1 Tools > Options > Display > Advanced > [ ] use fixed width font for plain text messages
2 ... [x] use fixed width font for plain text messages
Try

Code: Select all

pref.setBoolPref("mail.fixed_width_messages", !pref.getBoolPref("mail.fixed_width_messages"));

ReloadMessage();  


Works fine!

Thank you, Dorando :)
Andreas
Version of TB or FF used by me: the actual one
My tip collections for Thunderbird and Firefox (both in german language)
retepmu
Posts: 229
Joined: December 21st, 2002, 5:41 pm
Location: Berlin, Germany
Contact:

Re: keyconfig 20080929

Post by retepmu »

I like to create two other toggles, but because that are not boolean prefs, I cannot use the "fixed width switcher" as a template.

The first shortcut should toggle between:

1 View > Header > None
2 View > Header > Many
(I created these two sets via the extension Mnenhy.)

The code for the single functions is:

Code: Select all

goMnenhy.headers.SetView(goMnenhy.headers.gkiViewNoHeaders)
goMnenhy.headers.SetView(goMnenhy.headers.gkiViewManyHeaders)


The second shortcut should toggle between:

1 Message > Mark > As Junk
2 Message > Mark > As Not Junk

The code for the single functions is:

Code: Select all

goDoCommand("cmd_markAsNotJunk")
goDoCommand("cmd_markAsJunk")


If someone likes to help me with that, I would appreciate it :)

dorando wrote:
retepmu wrote:If you like to give me hints how one could discover the appropriate code for commands in general (when TB does not offer a shortcut by default), I would appreciate that a lot.


DOM Inspector and Mozilla Cross-Reference.

Thanks for these hints.
To be honest: For me as a non programmer that is to hard to understand.

May be there is a step by step manual, for some few, but important and typical "create a shortcut" tasks?
That would be great.
Last edited by retepmu on August 31st, 2010, 9:49 am, edited 2 times in total.
Andreas
Version of TB or FF used by me: the actual one
My tip collections for Thunderbird and Firefox (both in german language)
retepmu
Posts: 229
Joined: December 21st, 2002, 5:41 pm
Location: Berlin, Germany
Contact:

Re: keyconfig 20080929

Post by retepmu »

Does anyone know the code to set the focus to the folder pane and the header pane?

Thank you.

Code: Select all

SetFocusFolderPane();
or

Code: Select all

SetFocusHeaderPane();
has no effect.

For the message pane

Code: Select all

SetFocusMessagePane();
works fine.
Andreas
Version of TB or FF used by me: the actual one
My tip collections for Thunderbird and Firefox (both in german language)
User avatar
tonymec
Posts: 734
Joined: October 15th, 2004, 2:58 am
Location: Ixelles (Brussels Capital Region, Belgium)
Contact:

Re: keyconfig 20080929

Post by tonymec »

retepmu wrote:Does anyone know the code to set the focus to the folder pane and the header pane?

For the message-list pane (top-right in "classical" 3-pane layout) it's

Code: Select all

SetFocusThreadPane();
For the folder-tree pane I don't know.
Best regards,
Tony
retepmu
Posts: 229
Joined: December 21st, 2002, 5:41 pm
Location: Berlin, Germany
Contact:

Re: keyconfig 20080929

Post by retepmu »

@tonymec
Thanks.

Code: Select all

SetFocusThreadPane();

works fine.

Now just the code for the folder pane is missing.

Background: I like to read (and navigate in) mails (writing is another task) with just one hand on the number pad. No other interaction, no other interface.
I enjoy to switch the focus with 1, 2, 3.

I even created an extra delete key (-) for that "one hand number pad mode":

Code: Select all

goDoCommand("cmd_delete");
goDoCommand("cmd_nextUnreadMsg");


The standard del key is to far away for lazy users :)
Last edited by retepmu on September 2nd, 2010, 5:37 am, edited 1 time in total.
Andreas
Version of TB or FF used by me: the actual one
My tip collections for Thunderbird and Firefox (both in german language)
retepmu
Posts: 229
Joined: December 21st, 2002, 5:41 pm
Location: Berlin, Germany
Contact:

Re: keyconfig 20080929

Post by retepmu »

Is it possible to assign the enter key from the number pad to a function - and only to the enter key on number pad?
It should not take an effect on the enter key from the main keyboard field.
Andreas
Version of TB or FF used by me: the actual one
My tip collections for Thunderbird and Firefox (both in german language)
dorando
Posts: 1203
Joined: January 9th, 2004, 9:57 am
Contact:

Re: keyconfig 20080929

Post by dorando »

WCityMike wrote:Dorando, a real quick question: the "[Folder Name]" is the literal name of the folder (it's Mozilla's default name for a new folder), but it is always a different *actual* folder; it's whatever new folder I created to house my most recent set of bookmarks. I'm assuming that the folder's numerical ID would thus change. Is there still a way to do it based on focusing on the first occurrence of the name?
Try

Code: Select all

var folder = "[Folder Name]";

var result = PlacesUtils.getFolderContents(PlacesUtils.placesRootId, true);

var place = findFolder(result.root, folder);

function findFolder(rootNode, title) {
 rootNode.containerOpen = true;

 for (var i = 0; i < rootNode.childCount; i ++) {
  var node = rootNode.getChild(i).QueryInterface(Ci.nsINavHistoryContainerResultNode);
  if(node.title == title) return node.itemId;
  if(node.hasChildren) {
   var ret = findFolder(node, title);
   if(ret) return ret;
  }
 }

 rootNode.containerOpen = false;
}

var wm = Cc["@mozilla.org/appshell/window-mediator;1"].getService(Ci.nsIWindowMediator);
var organizer = wm.getMostRecentWindow("Places:Organizer");

if (!organizer) {
 organizer = openDialog("chrome://browser/content/places/places.xul",
             "", "chrome,toolbar=yes,dialog=no,resizable", folder);
 organizer.addEventListener("load", function(){
  organizer.removeEventListener(event.type, arguments.callee, true);
  organizer.PlacesUIUtils.leftPaneQueries[folder] = place;
 }, true);
}
 else {
 organizer.PlacesUIUtils.leftPaneQueries[folder] = place;
 organizer.PlacesOrganizer.selectLeftPaneQuery(folder);
 organizer.focus();
}
 

retepmu wrote:The first shortcut should toggle between:

1 View > Header > None
2 View > Header > Many
(I created these two sets via the extension Mnenhy.)

The code for the single functions is:

Code: Select all

goMnenhy.headers.SetView(goMnenhy.headers.gkiViewNoHeaders)
goMnenhy.headers.SetView(goMnenhy.headers.gkiViewManyHeaders)
Try

Code: Select all

if(goMnenhy.headers.GetHeaderView() != goMnenhy.headers.gkiViewNoHeaders)
 goMnenhy.headers.SetView(goMnenhy.headers.gkiViewNoHeaders);
else
 goMnenhy.headers.SetView(goMnenhy.headers.gkiViewManyHeaders);  
retepmu wrote:The second shortcut should toggle between:

1 Message > Mark > As Junk
2 Message > Mark > As Not Junk

The code for the single functions is:

Code: Select all

goDoCommand("cmd_markAsNotJunk")
goDoCommand("cmd_markAsJunk")
Try

Code: Select all

if(SelectedMessagesAreJunk())
 goDoCommand("cmd_markAsNotJunk");
else
 goDoCommand("cmd_markAsJunk");   
retepmu wrote:Does anyone know the code to set the focus to the folder pane [...]?
Try

Code: Select all

document.getElementById("folderTree").focus(); 
retepmu wrote:Is it possible to assign the enter key from the number pad to a function - and only to the enter key on number pad?
Bug 105990 - VK_ENTER is indistinguishable from VK_RETURN.
retepmu
Posts: 229
Joined: December 21st, 2002, 5:41 pm
Location: Berlin, Germany
Contact:

Re: keyconfig 20080929

Post by retepmu »

Thank you very much indeed, Dorando.
Andreas
Version of TB or FF used by me: the actual one
My tip collections for Thunderbird and Firefox (both in german language)
retepmu
Posts: 229
Joined: December 21st, 2002, 5:41 pm
Location: Berlin, Germany
Contact:

Re: keyconfig 20080929

Post by retepmu »

I like to use a shortcut, which executes a sequence of commands of different contexts.

Example for such a task:
"The user knows that he will reply (in the future), but he has no time (at the moment) to write the message immediately. He uses the (content of the) sent folder as a reminder."

Code: Select all

goDoCommand("cmd_reply");
goDoCommand("cmd_saveAsDraft");
goDoCommand("cmd_close");
goDoCommand("cmd_nextUnreadMsg");


That code executes only the function of the first line.

My question:
The first line needs the context "main window".
The second a third line need the context "draft window", while the fourth line again needs the context "main window".

How can I realize a shortcut for the described task please?
Thanks.
Last edited by retepmu on September 3rd, 2010, 4:27 am, edited 1 time in total.
Andreas
Version of TB or FF used by me: the actual one
My tip collections for Thunderbird and Firefox (both in german language)
jerdna
Posts: 1
Joined: September 3rd, 2010, 4:04 am

Re: keyconfig 20080929

Post by jerdna »

hi, my shortcut for panorama (ctrl+spacebar) doesnt work... can you please tell me how can i change that short cut into alt+spacebar or F1....
i have firefox 4
thanks
User avatar
tonymec
Posts: 734
Joined: October 15th, 2004, 2:58 am
Location: Ixelles (Brussels Capital Region, Belgium)
Contact:

Re: keyconfig 20080929

Post by tonymec »

jerdna wrote:hi, my shortcut for panorama (ctrl+spacebar) doesnt work... can you please tell me how can i change that short cut into alt+spacebar or F1....
i have firefox 4
thanks

To change the key assigned previously with keyconfig to some function:
  1. Start keyconfig from the appropriate window;
  2. Select the appropriate line in the list;
  3. Select (and highlight) the existing keystroke in the input box at the bottom;
  4. Hit the desired keystroke (or keystroke sequence or combination);
  5. Click "Apply" if desired;
  6. Click "Close".
The new keystroke will only be applied in new windows of that type opened afterwards.
Best regards,
Tony
WCityMike
Posts: 63
Joined: February 29th, 2004, 10:28 am
Location: Chicago, Illinois
Contact:

Re: keyconfig 20080929

Post by WCityMike »

Thanks, Dorando ... again, my great gratitude.
SleepyPrince
Posts: 4
Joined: August 11th, 2006, 10:54 am

Re: keyconfig 20080929

Post by SleepyPrince »

What is the function name of panorama? I couldn't find it in the keyconfig list
Post Reply