Hi,
Created a Service app to simulate keys. Override the Thread class to MyThread class to simulate keys.
Code Snippet:
Object* MyThread::Run(void) { AppLog("MyThread :: Object* Run(void)"); Tizen::Ui::KeyCode keyToSimulate = Tizen::Ui::KEY_A; result 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)); return null; }
In OnAppInitialized() created a Thread instance and started as below:
mpMyThread = new MyThread; mpMyThread->Construct(); mpMyThread->Start();
result of GenerateKeyEvent shows E_PRIVILEGE_DENIED. My question here does MyThread class has the privileges same as parent? If not how can i send events in MyThread class?
Thanks,
Anil