Module that manages keyboard operations on the chart.
- Download Keyboard.mqh
- Save the file to /MQL4/Include/mql4_modules/Keyboard/Keyboard.mqh
- Include Keyboard.mqh
- Pass lparam (this is a OnChartEvent function argument) as an argument to the Keyboard::Key.
- Keyboard::Key returns which key was pressed.
Keyboard::Key tells you which key was pressed.
void OnChartEvent(const int id,
const long& lparam,
const double& dparam,
const string& sparam
)
{
if(id==CHARTEVENT_KEYDOWN) {
Comment(Keyboard::Key(lparam));
}
}