Hello People,
Could somebody please tell me using which one of the following is better to simulate key events???
1. In the event of my method that simulates key strokes being called,using a local windows server session variable,connect to it,simulate keys and close it and repeat the same everytime my method is called as follows:
void method()
{
............
RWsSession ws;
ws.Connect();
.......
do the TkeyEvent accordingly here
......
ws.SimulatekeyEventL(TKeyEVent)
ws.Close();
}
2. Have a RWsSession variable as a member of my class, instantiate it in the constructor (as seen below) and do the same as above.
member variable RWsSession ws;
ws = iCoeEnv->WsSession(); in the constructor of the class
void method()
{
.......
do the TkeyEvent accordingly here
......
ws.SimulatekeyEventL(TKeyEVent)
}
// DO NOT DO ws.Close();
I am trying to write an application that simulates key events and can be integrated with any other application that can accept keystrokes like teh message editor etc..By integrated I mean, if my application runs and I open another one that can accept key strokes, since I use the SimulateKeyEventL method, it would appear as if the user typed on the other application.
Thanks a ton!

Reply With Quote

