Mouse Events / clicks

Questions about MultiCharts and user contributed studies.
johnromeronc
Posts: 23
Joined: 18 Feb 2011
Has thanked: 8 times
Been thanked: 6 times

Mouse Events / clicks

Postby johnromeronc » 20 Jun 2012

I created this sample indicator to see how the mouse buttons works. ACtually I found something and expanded it. My question is this - for the left click operations, my indicator works as expected. But the "Right" mouse click - my indicator gets control, and prints to the output widow as expected, but also the normal popup window (format, insert, etc ) still comes up. Also if I right click / Shift or right click/Ctrl while over the price data or indicator on a chart, Multicharts highlights the data/idicator as if I had only clicked the right mouse button.

Do I need to do something else in my indicator to tell multicharts to not handle mouse click. It seems control goes to both my indicator and Multicharts. Help from those smarter than me or further down the road would be appreciated.

Code: Select all

[ProcessMouseEvents = true];
var: var0(0), var1(0);

switch (getappinfo(aicalcreason)) begin
    case CalcReason_MouseLClick :
       if MouseClickCtrlPressed then begin
            var0 = MouseClickDateTime;
            var1 = datetime2eltime(var0);
        print("Left Cntl -> Time of the Bar = ", var1);
            end
       else
       if MouseClickShiftPressed then begin 
            var1 = MouseClickBarNumber;
        print("Left Shift --> Mouse Bar # = ", var1);
       end;     
    case CalcReason_MouseRClick :
       if MouseClickCtrlPressed then begin 
            var1 = MouseClickPrice;
        print("Right Ctrl --> Mouse Value = ", var1);
            end
       else
       if MouseClickShiftPressed then begin 
            var1 = MouseClickDataNumber;
        print("Right Shift --> Data Number # = ", var1);
   end;
   
end;

User avatar
Henry MultiСharts
Posts: 8448
Joined: 25 Aug 2011
Has thanked: 1207 times
Been thanked: 2705 times

Re: Mouse Events / clicks

Postby Henry MultiСharts » 22 Jun 2012

johnromeronc wrote:I created this sample indicator to see how the mouse buttons works. ACtually I found something and expanded it. My question is this - for the left click operations, my indicator works as expected. But the "Right" mouse click - my indicator gets control, and prints to the output widow as expected, but also the normal popup window (format, insert, etc ) still comes up. Also if I right click / Shift or right click/Ctrl while over the price data or indicator on a chart, Multicharts highlights the data/idicator as if I had only clicked the right mouse button.

Do I need to do something else in my indicator to tell multicharts to not handle mouse click. It seems control goes to both my indicator and Multicharts. Help from those smarter than me or further down the road would be appreciated.


Hello Johnromeronc,

Unfortunately there is no way to tell MultiCharts not to handle right mouse button clicks. This behavior cannot be changed.

johnromeronc
Posts: 23
Joined: 18 Feb 2011
Has thanked: 8 times
Been thanked: 6 times

Re: Mouse Events / clicks

Postby johnromeronc » 22 Jun 2012

Henry,

2 things,

1 - I am not asking MultiChart to 'not handle' right click. I am asking it to only handle right click by itself, and pass to my indicator Ctrl-R-Click and Shift-R-Click.

2 - On Left click, the engineers need to use a more specific selection criteria in their routine handling mouse clicks / events.
- On only left click by itself, and the pointer is over data, indicator, or other object, Multicharts should handle and it should select the object.
- when someone Ctrl-L-Click or Shift-L-Click, Multicharts should not interpret it as something I am asking it to handle, but pass it on to my indicator. Example, in my indicator I may want to select close of a bar. I will use Ctrl-Left-Click. As it currently is implemented, MultiCharts will highlight / select the data(because of left click) and then pass control to my indicator, which then lets me get the appropriate info and perform my stuff.

In both cases, MultiCharts needs to only 'do something' based on Left/Right mouse click "Only" with no other key combinations. So, the engineers need to expand its current (original) logic to insure the new capabilities now provided in Ver 8 are cleaner.

I can complete my project to do what I want, but it causes me extra steps, and the possibility of errors of deleting / moving something on a chart or making a menu selection I never intended to do.

Another side effect is that if I were to implement any keyboard macro's, they could be effects by the 'state' of the window, something highlighted, or menu on the screen, causing unknown results.

John
These users thanked the author johnromeronc for the post:
JoshM

User avatar
Henry MultiСharts
Posts: 8448
Joined: 25 Aug 2011
Has thanked: 1207 times
Been thanked: 2705 times

Re: Mouse Events / clicks

Postby Henry MultiСharts » 29 Jun 2012

Hello John,

We will consider possible improvements of this apect of MultiCharts in the future. You may want to submit a feature request to the Project Management of our web site to keep track of it: https://www.multicharts.com/pm/


Return to “MultiCharts”