I should capture the volumeup and volumedown events in a qt program.
I saw this document http://www.developer.nokia.com/Commu...ing_media_keys
And I have make this object:
cmediakeygest.h
Code:
#ifndef CMEDIAKEYGEST_H
#define CMEDIAKEYGEST_H
#include <remconcoreapitargetobserver.h>
#include <remconcoreapitarget.h>
#include <remconinterfaceselector.h>
#include <mw/aknappui.h>
#include <QObject>
class CMediaKeygest: public QObject, CAknAppUi,
public MRemConCoreApiTargetObserver
{
Q_OBJECT
public:
CMediaKeygest(QObject *parent);
void MrccatoCommand(TRemConCoreApiOperationId aOperationId,
TRemConCoreApiButtonAction aButtonAct);
signals:
void volumeupclicked();
void volumedownclicked();
private:
CRemConInterfaceSelector* iInterfaceSelector;
CRemConCoreApiTarget* iCoreTarget;
};
#endif // CMEDIAKEYGEST_H
cmediakeygest.cpp
Code:
#include "cmediakeygest.h"
CMediaKeygest::CMediaKeygest(QObject *parent)
{
setParent(parent);
iInterfaceSelector = CRemConInterfaceSelector::NewL();
iCoreTarget = CRemConCoreApiTarget::NewL(*iInterfaceSelector, *this);
iInterfaceSelector->OpenTargetL();
}
void CMediaKeygest::MrccatoCommand(TRemConCoreApiOperationId aOperationId, TRemConCoreApiButtonAction aButtonAct)
{
TRequestStatus status;
switch(aOperationId)
{
case ERemConCoreApiVolumeUp:
{
switch (aButtonAct)
{
case ERemConCoreApiButtonClick:
emit volumeupclicked();
break;
default:
break;
}
iCoreTarget->VolumeUpResponse(status, KErrNone);
User::WaitForRequest(status);
break;
case ERemConCoreApiVolumeDown:
{
switch (aButtonAct)
{
case ERemConCoreApiButtonClick:
emit volumedownclicked();
break;
default:
break;
}
iCoreTarget->VolumeDownResponse(status, KErrNone);
User::WaitForRequest(status);
break;
}
}
}
}
but when I try to allocate the object with "new" I get this error:
C:\QtSDK\Symbian\SDKs\Symbian3Qt474\epoc32\include\e32base.inl:36: error: 'static TAny* CBase:
perator new(TUint)' is inaccessible