Marcus Riemenschneider: can someone tell me what's wrong with this script?
| Key up value is wrong. Try: |
#property strict #include <WinUser32.mqh> //+------------------------------------------------------------------+ //| Script program start function | //+------------------------------------------------------------------+ void OnStart() { //--- keybd_event(VK_LMENU, 0, 1, 0); keybd_event(VK_R, 0, 0, 0); keybd_event(VK_R, 0, KEYEVENTF_KEYUP, 0); keybd_event(VK_LMENU, 0, KEYEVENTF_KEYUP, 0); } //+------------------------------------------------------------------+
whroeder1:
Key up value is wrong. Try: |
I changed it but it still doesn't work. Then I only changed the value for key up and this also doesn't work.
Very strange because it works in another indicator where I am using a hotkey (CTRL + O).
Any other idea?
#property strict #import "user32.dll" void keybd_event(int bVk, int bScan, int dwFlags,int dwExtraInfo); #import #define REL 0x0002 #define ALT 0x12 #define R 0x52 void OnStart() { keybd_event(ALT,0,0, 0); keybd_event(R, 0,0, 0); keybd_event(ALT,0,REL,0); keybd_event(R, 0,REL,0); }
honest_knave:
Works perfect now! Thank you! :)
I used a wrong value for ALT. Obviously there was an error in the key-code-table I where found it.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Hey guys,
can someone tell me what's wrong with this script?