Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Figuring out button or key command that activated add-on code
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Jonathan Kamens  
View profile  
 More options Jun 4 2012, 12:39 pm
Newsgroups: mozilla.dev.extensions, mozilla.dev.apps.thunderbird
From: j...@kamens.us (Jonathan Kamens)
Date: Mon, 4 Jun 2012 16:39:24 +0000 (UTC)
Local: Mon, Jun 4 2012 12:39 pm
Subject: Figuring out button or key command that activated add-on code
My Thunderbird add-on has some code tied to the
compose-send-message event, which is fired off from within
Thunderbird's core GenericSendMessage function when a message
is about to be delivered.

I need to figure out in my code specifically how sending the
message was triggered, e.g., Ctrl-Enter, Ctrl-Shift-Enter,
"Send" button, "Send Later" button, etc.

I would rather not replace the code for all of these built-in
triggers with custom code that sticks some state somewhere to
tell me what the trigger was. I'm hoping there's some other
way to do it.

One possibility I thought of is to wonder whether there is
some way to gain access to a list of currently "active"
events, such that I could look in that list to see what kind
of event was the trigger for the currently running JavaScript
code.

Any suggestions?

Thanks,

  jik


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
whitedav...@fastmail.us  
View profile  
 More options Jun 4 2012, 2:19 pm
Newsgroups: mozilla.dev.extensions, mozilla.dev.apps.thunderbird
From: whitedav...@fastmail.us
Date: Mon, 04 Jun 2012 11:19:22 -0700
Local: Mon, Jun 4 2012 2:19 pm
Subject: Re: Figuring out button or key command that activated add-on code

Anything in the event object passed to your handler?

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
whitedav...@fastmail.us  
View profile  
 More options Jun 4 2012, 2:43 pm
Newsgroups: mozilla.dev.extensions, mozilla.dev.apps.thunderbird
From: whitedav...@fastmail.us
Date: Mon, 04 Jun 2012 11:43:50 -0700
Local: Mon, Jun 4 2012 2:43 pm
Subject: Re: Figuring out button or key command that activated add-on code

whitedav...@fastmail.us wrote:
> Anything in the event object passed to your handler?

In checking the source code where the event is setup and sent
(chrome\messenger\content\messenger\messengercompose\MsgComposeCommands.js) ,
I don't see anything added to the event that will help. The event is
setup as a UIEvent
<https://developer.mozilla.org/en/DOM/document.createEvent#Notes> but is
initialized with initEvent before sending rather than initUIEvent
<https://developer.mozilla.org/en/DOM/event.initUIEvent>. But it is not
clear that the info you seek is even available at that point anyhow.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »