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 20110522

Post by dorando »

Ziron5 wrote:is there a list of code lines beside the examples?
The MozillaZine Knowledge Base has some more examples (mostly Thunderbird), otherwise the Mozilla Developer Network ( List of commands ) or Mozilla Cross-Reference might be helpful.
Ziron5 wrote:So what do I have to write into the code-box when I create a new shortcut, to simply let it "select all" and "copy"?
Try

Code: Select all

goDoCommand("cmd_selectAll");
goDoCommand("cmd_copy"); 
Support mozilla.dorando.at through donations/contributions.
Patu
Posts: 31
Joined: September 24th, 2008, 2:20 am

Re: keyconfig 20110522

Post by Patu »

dorando wrote:
Patu wrote:Any time the page opens the cursor jumps into an embedded field where the command you gave to me doesn't work.
For me it actually will only work if the cursor is in the text field (not for single letter key); if the focus is outside, the page will prevent the shortcut (see Bug 380637 - Should web pages be able to override the browser's keyboard shortcuts?).

You could try Customizable Shortcuts (together with keyconfig) since it does its own shortcut handling (unlike keyconfg).

I read the link about the mozilla bug, and I installed the add-on, but that actually got me nowhere. So, I just assume the website prevents keyconfig from working properly. Such a pity. Anyway, thanks for your help, dorando.
Ziron5
Posts: 2
Joined: May 19th, 2014, 6:43 am

Re: keyconfig 20110522

Post by Ziron5 »

Thank you very much. Works exactly how I wanted it :)
dorando
Posts: 1203
Joined: January 9th, 2004, 9:57 am
Contact:

Re: keyconfig 20110522

Post by dorando »

Patu wrote:I read the link about the mozilla bug, and I installed the add-on, but that actually got me nowhere. So, I just assume the website prevents keyconfig from working properly. Such a pity. Anyway, thanks for your help, dorando.
You need to assign a shortcut with Customizable Shortcuts which is different than the one assigned in keyconfig (reassign it in keyconfig to one you wouldn't use, or disable it; might require a restart).
Support mozilla.dorando.at through donations/contributions.
Patu
Posts: 31
Joined: September 24th, 2008, 2:20 am

Re: keyconfig 20110522

Post by Patu »

dorando wrote:
Patu wrote:I read the link about the mozilla bug, and I installed the add-on, but that actually got me nowhere. So, I just assume the website prevents keyconfig from working properly. Such a pity. Anyway, thanks for your help, dorando.
You need to assign a shortcut with Customizable Shortcuts which is different than the one assigned in keyconfig (reassign it in keyconfig to one you wouldn't use, or disable it; might require a restart).

That is just great. I don't know why but it works. YEAHHH! Thanks again, dorando.
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 »

dorando wrote:
Patu wrote:Any time the page opens the cursor jumps into an embedded field where the command you gave to me doesn't work.
For me it actually will only work if the cursor is in the text field (not for single letter key); if the focus is outside, the page will prevent the shortcut (see Bug 380637 - Should web pages be able to override the browser's keyboard shortcuts?).

You could try Customizable Shortcuts (together with keyconfig) since it does its own shortcut handling (unlike keyconfg).


Warning: Customizable Shortcuts is for Firefox only. Using it with Thunderbird or SeaMonkey would require, as a minimum, additional <em:targetApplication> sections in the install.rdf file and it might require additions to other files: I haven't tested it.
Notes:
  • an .xpi is a .zip with a different name
  • The following ought to work for all Toolkit-based extensions; you can add it below the <em:targetApplication> element for Firefox, or even in its stead:

    Code: Select all

        <!-- Toolkit version -->
        <em:targetApplication>
          <Description>
            <em:id>toolkit@mozilla.org</em:id>
            <em:minVersion>21.0</em:minVersion>
            <em:maxVersion>32.0.*</em:maxVersion>
          </Description>
        </em:targetApplication>
Best regards,
Tony
bege
Posts: 153
Joined: January 23rd, 2009, 9:14 pm
Location: Germany

Re: keyconfig 20110522

Post by bege »

Hi,

I cannot open keyconfig in the bookmarks window with a shortcut even if "global" is checked.

How can I add in this window a new folder with a shortcut? "placesCmd_new:folder" doesn't work.
dorando
Posts: 1203
Joined: January 9th, 2004, 9:57 am
Contact:

Re: keyconfig 20110522

Post by dorando »

bege wrote:I cannot open keyconfig in the bookmarks window with a shortcut even if "global" is checked.
Works for me, ensure that you assigned a shortcut to the duplicated <key> (since you can't edit the original one).
bege wrote:How can I add in this window a new folder with a shortcut? "placesCmd_new:folder" doesn't work.
Open the Library, select it from the dropdown, and try

Code: Select all

goDoPlacesCommand('placesCmd_new:folder'); 
Support mozilla.dorando.at through donations/contributions.
bege
Posts: 153
Joined: January 23rd, 2009, 9:14 pm
Location: Germany

Re: keyconfig 20110522

Post by bege »

dorando wrote:
bege wrote:I cannot open keyconfig in the bookmarks window with a shortcut even if "global" is checked.
Works for me, ensure that you assigned a shortcut to the duplicated <key> (since you can't edit the original one).
bege wrote:How can I add in this window a new folder with a shortcut? "placesCmd_new:folder" doesn't work.
Open the Library, select it from the dropdown, and try

Code: Select all

goDoPlacesCommand('placesCmd_new:folder'); 

Perfect, thank you, dorando =D> :)
ventainais
Posts: 9
Joined: May 29th, 2014, 12:43 am

Re: keyconfig 20110522

Post by ventainais »

Hello!

I can't find a solution for my problem, I hope someone can help me.


I am trying to copy to clipboard last reply with subject/date/from/to
I made a keyconfig for opening my helpdesk ticket and I want to add the "copy to clipboard function", but I can't find an example how to do that.
For now all I have is the openurl function

fnxweb.urllink.MailOpenLink(event,'','http://test.helpdesk.org/front/tracking.form.php?ID=')
dorando
Posts: 1203
Joined: January 9th, 2004, 9:57 am
Contact:

Re: keyconfig 20110522

Post by dorando »

Assuming Thunderbird, try

Code: Select all

Components.classes["@mozilla.org/widget/clipboardhelper;1"].getService(Components.interfaces.nsIClipboardHelper)
.
copyString([
 
gMessageDisplay.displayedMessage.mime2DecodedSubject,
 new 
Date(gMessageDisplay.displayedMessage.dateInSeconds 1000),
 
gMessageDisplay.displayedMessage.mime2DecodedAuthor,
 
gMessageDisplay.displayedMessage.mime2DecodedRecipients
].join("\r\n")); 
which should copy data from the currently selected/opened message.
Support mozilla.dorando.at through donations/contributions.
ventainais
Posts: 9
Joined: May 29th, 2014, 12:43 am

Re: keyconfig 20110522

Post by ventainais »

Thank you for the reply.

The code does copy "some" info.
Example:

Subject: Ticket nr. 59759
Thu May 29 2014 16:31:41 GMT+0300 (FLE Daylight Time)
John Silver <john.silver@mail.uu>
'Helpdesk' <hd@helpd.uu>

It wont copy the message from it.
dorando
Posts: 1203
Joined: January 9th, 2004, 9:57 am
Contact:

Re: keyconfig 20110522

Post by dorando »

Try

Code: Select all

MsgHdrToMimeMessage(gFolderDisplay.selectedMessage, null, function (aMsgHdr, aMimeMessage) {
 Components.classes["@mozilla.org/widget/clipboardhelper;1"].getService(Components.interfaces.nsIClipboardHelper)
 .copyString([
  aMsgHdr.mime2DecodedSubject,
  new Date(aMsgHdr.dateInSeconds * 1000),
  aMsgHdr.mime2DecodedAuthor,
  aMsgHdr.mime2DecodedRecipients,
  "",
  aMimeMessage.coerceBodyToPlaintext(gFolderDisplay.displayedFolder).replace(/^\W+/,"").replace(/\W+$/g,"").replace(/\n/g,"\r\n")
 ].join("\r\n"));
}, true);
Support mozilla.dorando.at through donations/contributions.
ventainais
Posts: 9
Joined: May 29th, 2014, 12:43 am

Re: keyconfig 20110522

Post by ventainais »

dorando wrote:Try

Code: Select all

MsgHdrToMimeMessage(gFolderDisplay.selectedMessage, null, function (aMsgHdr, aMimeMessage) {
 Components.classes["@mozilla.org/widget/clipboardhelper;1"].getService(Components.interfaces.nsIClipboardHelper)
 .copyString([
  aMsgHdr.mime2DecodedSubject,
  new Date(aMsgHdr.dateInSeconds * 1000),
  aMsgHdr.mime2DecodedAuthor,
  aMsgHdr.mime2DecodedRecipients,
  "",
  aMimeMessage.coerceBodyToPlaintext(gFolderDisplay.displayedFolder).replace(/^\W+/,"").replace(/\W+$/g,"").replace(/\n/g,"\r\n")
 ].join("\r\n"));
}, true);




Thank you for the response.
The code copies all the mail content, but I need it to copy the last reply.
raindog
Posts: 70
Joined: December 16th, 2002, 3:55 am

Re: keyconfig 20110522

Post by raindog »

Please, am I missing something, or how to add a keyboard combo (something like Alt-1 on Windows and Option-1 on Mac) to open a bookmark from a bookmarks' toolbar?

Would be grateful for detailed instructions, please :).


Thank you.
Post Reply