Detecting right mouse button click in MQL5

 

Please, what is the correct way to detect a right mouse button click in MQL5?

I am aware that, at the Windows level, the right mouse button is commonly represented by 0x02 . However, I am not sure whether relying on this value (for example by comparing lparam during CHARTEVENT_MOUSE_MOVE ) is reliable, which seems not to work.

I would appreciate experienced opinions on the best practice for handling right-click detection in MQL5. Any clarification or example would be of great use.

Thank you
 

CHARTEVENT_MOUSE_MOVE is the way to go.

 
Alain Verleyen #:

CHARTEVENT_MOUSE_MOVE is the way to go.

Thank you for your response.

indeed, CHARTEVENT_MOUSE_MOVE is the way as you said, but am finding it difficult to detect mouse-right click, while mouse is in motion / move.
 
Chukwubuikem Okeke #:
Thank you for your response.

indeed, CHARTEVENT_MOUSE_MOVE is the way as you said, but am finding it difficult to detect mouse-right click, while mouse is in motion / move.
You need to post your code if you want coding help.
 
Alain Verleyen #:
You need to post your code if you want coding help.

Someone is stuck here 

void OnChartEvent(const int32_t id, const long& lparam, const double& dparam, const string& sparam) {
//---

   switch(id) {

   case CHARTEVENT_OBJECT_CLICK:
      if(sparam == TOGGLE_BUTTON) {
         toggleButtonState(TOGGLE_BUTTON, isMenuON);
      }
      break;
   case CHARTEVENT_MOUSE_MOVE:
      if(lparam == 0X02) {
         Print("Right-click held also!");
      }
      break;
   }

}
 
Chukwubuikem Okeke #:

Someone is stuck here 

Why are you using lparam ? What the documentation said ?
 
Alain Verleyen #:
Why are you using lparam ? What the documentation said ?
Maybe i couldn't find anything in the documentation, thats why am here 


And it happened that you replied, which i do appreciate.

So do help out with the best logic or something