How to detect shift key was pressed from editor ruler double click action?

View: New views
3 Messages — Rating Filter:   Alert me  

How to detect shift key was pressed from editor ruler double click action?

by normankyee :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I've defined an editor ruler double click action through my plugin.xml like so:

   <extension
         point="org.eclipse.ui.editorActions">
      <editorContribution
            targetID="org.eclipse.cdt.ui.editor.CEditor"
            id="myplugin.editors.c.rulerActions">
         <action
               label="Not Used"
                class="myplugin.ui.actions.RulerToggleBreakpointActionDelegate"
               actionID="RulerDoubleClick"
               id="myplugin.editors.c.ManageBreakpointRulerAction">
         </action>

How do I detect if the shift key is currently pressed in the ruler double click action's createAction() method?

Regards,
Norman Yee





     
_______________________________________________
cdt-dev mailing list
cdt-dev@...
https://dev.eclipse.org/mailman/listinfo/cdt-dev

Re: [Bulk] How to detect shift key was pressed from editor ruler double click action?

by Alex Chapiro-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm afraid the question "as is" doesn't make sense. Double click
contains of at least 4 mouse events (BtnDn, BtnUp,BtnDn, BtnUp), so this
is not an atomic event, keyboard stat can change between  sub-actions.
The best you can do is to monitor keyboard state for each mouse
sub-event and use it for any appropriate purpose.

On 20/10/2009 11:28 AM, Norman Yee wrote:

> I've defined an editor ruler double click action through my plugin.xml like so:
>
>     <extension
>           point="org.eclipse.ui.editorActions">
>        <editorContribution
>              targetID="org.eclipse.cdt.ui.editor.CEditor"
>              id="myplugin.editors.c.rulerActions">
>           <action
>                 label="Not Used"
>                  class="myplugin.ui.actions.RulerToggleBreakpointActionDelegate"
>                 actionID="RulerDoubleClick"
>                 id="myplugin.editors.c.ManageBreakpointRulerAction">
>           </action>
>
> How do I detect if the shift key is currently pressed in the ruler double click action's createAction() method?
>
> Regards,
> Norman Yee
>
>
>
>
>
>
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@...
> https://dev.eclipse.org/mailman/listinfo/cdt-dev
>
>    
_______________________________________________
cdt-dev mailing list
cdt-dev@...
https://dev.eclipse.org/mailman/listinfo/cdt-dev

Re: [Bulk] How to detect shift key was pressed from editor ruler double click action?

by normankyee :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ok, I'll rephrase my question to make it more clear.  I want to detect if the shift key is pressed when the user double clicks on the editor's ruler to toggle a breakpoint.  I've created a toggle breakpoint action as described in my previous message.  AFAIK, it doesn't have any notion of the button up, button down, mouse events.  Is it possible to detect if the shift key is pressed from the action's createAction() method?

Regards,
Norman Yee

--- On Tue, 10/20/09, Alex Chapiro <alex.chapiro@...> wrote:

> From: Alex Chapiro <alex.chapiro@...>
> Subject: Re: [Bulk] [cdt-dev] How to detect shift key was pressed from editor ruler double click action?
> To: "CDT General developers list." <cdt-dev@...>
> Date: Tuesday, October 20, 2009, 8:01 PM
> I'm afraid the question "as is"
> doesn't make sense. Double click
> contains of at least 4 mouse events (BtnDn, BtnUp,BtnDn,
> BtnUp), so this
> is not an atomic event, keyboard stat can change
> between  sub-actions.
> The best you can do is to monitor keyboard state for each
> mouse
> sub-event and use it for any appropriate purpose.
>
> On 20/10/2009 11:28 AM, Norman Yee wrote:
> > I've defined an editor ruler double click action
> through my plugin.xml like so:
> >
> >     <extension
> >       
>    point="org.eclipse.ui.editorActions">
> >        <editorContribution
> >             
> targetID="org.eclipse.cdt.ui.editor.CEditor"
> >             
> id="myplugin.editors.c.rulerActions">
> >       
>    <action
> >             
>    label="Not Used"
> >               
>  
> class="myplugin.ui.actions.RulerToggleBreakpointActionDelegate"
> >             
>    actionID="RulerDoubleClick"
> >             
>    id="myplugin.editors.c.ManageBreakpointRulerAction">
> >       
>    </action>
> >
> > How do I detect if the shift key is currently pressed
> in the ruler double click action's createAction() method?
> >
> > Regards,
> > Norman Yee
> >
> >
> >
> >
> >
> >
> > _______________________________________________
> > cdt-dev mailing list
> > cdt-dev@...
> > https://dev.eclipse.org/mailman/listinfo/cdt-dev
> >
> >   
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@...
> https://dev.eclipse.org/mailman/listinfo/cdt-dev
>



_______________________________________________
cdt-dev mailing list
cdt-dev@...
https://dev.eclipse.org/mailman/listinfo/cdt-dev