keyconfig 20110522

Announce and Discuss the Latest Theme and Extension Releases.
Post Reply
User avatar
RobertJ
Moderator
Posts: 10880
Joined: October 15th, 2003, 7:40 pm
Location: Chicago IL/Oconomowoc WI

Re: keyconfig 20080929

Post by RobertJ »

You can also find set by step instructions to make it compatible with FF4 here including how to open, modify and repackage a xpi file.
FF 92.0 - TB 78.13 - Mac OSX 10.13.6
Malvineous
Posts: 22
Joined: August 31st, 2007, 4:58 am
Location: Brisbane, Australia
Contact:

Re: keyconfig 20080929

Post by Malvineous »

Oh fantastic, that worked to add a new shortcut key! Sorry, I thought that button was for adding a new shortcut to the selected item :-/
mad.engineer
Posts: 314
Joined: August 8th, 2006, 4:08 pm

Re: keyconfig 20080929

Post by mad.engineer »

dorando, I added the following function via Keconfig to close the Message Compose Window in TB 3.1.7 Windows 7:

goDoCommand('cmd_close').focus();

It is working fine. However, I notice that whenever I use it, I see the following Error Message show up in the Error Console window:

Error: goDoCommand("cmd_close") is undefined
Source File: chrome://messenger/content/messengercompose/messengercompose.xul Line: 1

Do you know what may be causing this error and any way to fix it by making any changes to the above function?. Thanks
dorando
Posts: 1203
Joined: January 9th, 2004, 9:57 am
Contact:

Re: keyconfig 20080929

Post by dorando »

Try just

Code: Select all

goDoCommand('cmd_close'
sloperb
Posts: 3
Joined: January 7th, 2011, 11:57 am

Re: keyconfig 20080929

Post by sloperb »

I'm trying to create a keyconfig shortcut to go to a specific folder in Thunderbird 3.1.7.

This URL (http://kb.mozillazine.org/Keyconfig_extension) suggests the following code should work (where URI is substituted with the folder URI I want):

const uri = "mailbox://someone@pop.example.com/Inbox"
with (document.getElementById("folderTree").view)
for (var i = 0; i < rowCount; ++i) with (getResourceAtIndex(i))
uri == Value? selection.select(i) :
uri.indexOf(Value) == 0 && !isContainerOpen(i)? toggleOpenState(i) : null

When I do this though I get:

Error: getResourceAtIndex is not defined
Source File: chrome://messenger/content/messenger.xul
Line: 3

Any suggestions?
User avatar
Philip Chee
Posts: 6475
Joined: March 1st, 2005, 3:03 pm
Contact:

Re: keyconfig 20080929

Post by Philip Chee »

sloperb wrote:I'm trying to create a keyconfig shortcut to go to a specific folder in Thunderbird 3.1.7.

This URL (http://kb.mozillazine.org/Keyconfig_extension) suggests the following code should work (where URI is substituted with the folder URI I want):

Code: Select all

const uri = "mailbox://someone@pop.example.com/Inbox"
with (document.getElementById("folderTree").view)
for (var i = 0; i < rowCount; ++i) with (getResourceAtIndex(i))
uri == Value? selection.select(i) :
uri.indexOf(Value) == 0 && !isContainerOpen(i)? toggleOpenState(i) : null

When I do this though I get:

Code: Select all

Error: getResourceAtIndex is not defined
Source File: chrome://messenger/content/messenger.xul
Line: 3

Any suggestions?

http://mxr.mozilla.org/mozilla1.9.2/search?string=getResourceAtIndex&find=%2Fmail&findi=&filter=%5E%5B%5E%5C0%5D*%24&hitlimit=&tree=mozilla1.9.2
getResourceAtIndex is not available in Thunderbird 3.1

Phil
sloperb
Posts: 3
Joined: January 7th, 2011, 11:57 am

Re: keyconfig 20080929

Post by sloperb »

That would explain the error message. Any suggestions on how to solve my problem?
User avatar
Philip Chee
Posts: 6475
Joined: March 1st, 2005, 3:03 pm
Contact:

Re: keyconfig 20080929

Post by Philip Chee »

sloperb wrote:That would explain the error message. Any suggestions on how to solve my problem?

Dunno. Try something like:

Code: Select all

      var folder = GetMsgFolderFromUri("mailbox://someone@pop.example.com/Inbox", true);
      if(folder) {
        // ensure folder is visible
        var folderTree = document.getElementById("folderTree");
        if (window.gFolderTreeView)
          gFolderTreeView.selectFolder(folder);
        else
          EnsureFolderIndex(folderTree.builderView, folder);
      }

Phil
emil9216
Posts: 13
Joined: September 23rd, 2008, 2:26 am

Re: keyconfig 20080929

Post by emil9216 »

Hello,

I would like to ask is it possible to assign a key sequence combination. For example, pressing two times "C" to copy, and pressing two times "V" to paste? I am using firefox 3.5.


Thanks!
mad.engineer
Posts: 314
Joined: August 8th, 2006, 4:08 pm

Re: keyconfig 20080929

Post by mad.engineer »

dorando, Currently in TB 3.1.7, the Ctrl+J key maps to the "Rewrap" function, which re-wraps the whole message compose content. Is there any way I can create a key via Keyconfig such that it will "only" re-wrap the current line/paragraph where the cursor is currently at? (Not the whole page). Thanks
Last edited by mad.engineer on January 16th, 2011, 1:07 pm, edited 1 time in total.
goooog
Posts: 1
Joined: January 13th, 2011, 1:51 pm

Re: keyconfig 20080929

Post by goooog »

Hello.
Does anyone know the new code for a dTa OneClick (DownThemAll!2.0) shortcut? because the old one does not work.
dorando
Posts: 1203
Joined: January 9th, 2004, 9:57 am
Contact:

Re: keyconfig 20080929

Post by dorando »

emil9216 wrote:I would like to ask is it possible to assign a key sequence combination. For example, pressing two times "C" to copy, and pressing two times "V" to paste? I am using firefox 3.5.
For calling copy twice then paste twice try something like

Code: Select all

goDoCommand("cmd_copy");
goDoCommand("cmd_copy");
goDoCommand("cmd_paste");
goDoCommand("cmd_paste");  
for pressing C twice then V twice try something like

Code: Select all

var utils = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor).
getInterface(Components.interfaces.nsIDOMWindowUtils);

var text = "CCVV";
for(
var position in text) {
 utils.sendKeyEvent("keydown", text.charCodeAt(position), 0, 0);
 utils.sendKeyEvent("keypress", 0, text.charCodeAt(position), 0);
 utils.sendKeyEvent("keyup", text.charCodeAt(position), 0, 0);
}
  

mad.engineer wrote:Is there any way I can create a key via Keyconfig such that it will "only" re-wrap the current line/paragraph where the cursor is currently at?
Try

Code: Select all

goDoCommand("cmd_beginLine");

var utils = content.QueryInterface(Components.interfaces.nsIInterfaceRequestor).
getInterface(Components.interfaces.nsIDOMWindowUtils);

var range = content.getSelection().getRangeAt(0);

var span = content.document.createElement('span');
range.startContainer.parentNode.insertBefore(span, range.startContainer);
var rect = span.getBoundingClientRect();
span.parentNode.removeChild(span);

utils.sendMouseEvent("mousedown", rect.left, rect.top, 0, 4, 0);
utils.sendMouseEvent("mouseup", rect.left, rect.top, 0, 4, 0);

goDoCommand("cmd_rewrap");  

goooog wrote:Does anyone know the new code for a dTa OneClick (DownThemAll!2.0) shortcut?
Try

Code: Select all

document.getElementById("dtaCtxTDTA").doCommand();  
mad.engineer
Posts: 314
Joined: August 8th, 2006, 4:08 pm

Re: keyconfig 20080929

Post by mad.engineer »

Thanks for the code. I tried it and it seem to work, but noticed that often it won't re-wrap the paragraph correctly. What I'm looking for is similar to the Justify/Re-wrap in the UNIX Pico command. PICO defines paragraphs as text surrounded by blank lines or indentation. For example, suppose you had the following lines in your text file:

> It followed her to school one week
> to see what it could find,
> it then learned French so well
> It blew little Mary's mind.

If you were to place the cursor within the first three lines and press Ctrl-J, the text would then look like the following:

> It followed her to school one week to see what it could find, it then learned French so well

It blew little Mary's mind.

However, if you had a blank line between each line of text, pressing ctrl-j would not affect the text. So I'm looking to do the same functionality as mentioned above via Keyconfig. Currently when I use re-wrap in the above example, I get this instead:

> It followed her to school one week
to see what it could find,
it then learned French so well
It blew little Mary's mind.

> stays on the first line and the the subsequent lines all get messed up like above. Would appreciate if you could provide a code that would do this. Thanks again for your great add-on.
emil9216
Posts: 13
Joined: September 23rd, 2008, 2:26 am

Re: keyconfig 20080929

Post by emil9216 »

Is it possible to make "space+T" key combination for opening a new tab? I can assign "space" for opening a new tab but i can't assign this combination "space+T".

Thanks!
mad.engineer
Posts: 314
Joined: August 8th, 2006, 4:08 pm

Re: keyconfig 20080929

Post by mad.engineer »

Is it possible to update the compatibility info of keyconfig for TB 3.3a2?. I tried disabling the compatibility check but it still would not work in TB. Thanks
Post Reply