Hi,
I have created sample application that will launch Message app, which inturn generates and sends KEY_1 using Tizen::Ui::SystemUtil::GenerateKeyEvent().
Code Snippet of the code:
String strAppName = L"tizen.messages"; result r; Tizen::App::AppControl* pAc = AppManager::FindAppControlN(strAppName, L"http://tizen.org/appcontrol/operation/compose"); if (pAc) { r = pAc->Start(null, null, null, null); delete pAc; } AppLog("Application launch status : [%s]", GetErrorMessage(r)); sleep(2); Tizen::Ui::KeyCode keyToSimulate = Tizen::Ui::KEY_1; r = Tizen::Ui::SystemUtil::GenerateKeyEvent(Tizen::Ui::KEY_EVENT_TYPE_PRESSED, keyToSimulate); AppLog("KEY_EVENT_TYPE_PRESSED [%d] and result :: %s", keyToSimulate, GetErrorMessage(r)); r = Tizen::Ui::SystemUtil::GenerateKeyEvent(Tizen::Ui::KEY_EVENT_TYPE_RELEASED, keyToSimulate); AppLog("KEY_EVENT_TYPE_RELEASED [%d] and result :: %s", keyToSimulate, GetErrorMessage(r));
Application launched successfully and the result of the GenerateKeyEvent pressed and released is E_SUCCESS. The value '1' is not getting printed on the Message app.
Please help me to simulate the keys.
Thanks,
Anil.