please help on capturing word or ASCII from the keyboard

[Deleted]  
Hi everybody, I'd want to know if the MQL4 language has the ability on capturing word or ASCII from the keyboard? And how?

sorry for my english!

Beat regards
[Deleted]  
Create a script, run a loop and periodically call user32.dll GetKeyState function.
[Deleted]  
Oh,thx so much! I'll try it.


Btw, another question, maybe U can help me :
if I have a buy order and a sell order at the same symbol .I'd like to close those two orders ,How can I control it in EA?
Need I use a globle variable or static or something....... and if globle can do it , how can I define a globle at mt3.86?

Best regards
[Deleted]  
void CloseOrders(string symbol) 
{  
  int cnt = OrdersTotal();
  for (int i=cnt-1; i >= 0; i--) {
    if (!OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) continue;
    if (OrderSymbol() != symbol) continue;
    
    int type = OrderType();
    
    if (type == OP_BUY) {
      CloseOrder(OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_BID));
    }
          
    if (type == OP_SELL) {
      CloseOrder(OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_ASK));
    }
  }
  
}