CHARTEVENT_MOUSE_MOVE is the way to go.
Alain Verleyen #:
You need to post your code if you want coding help.
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; } }
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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