本文整理汇总了C++中TRawEvent::Type方法的典型用法代码示例。如果您正苦于以下问题:C++ TRawEvent::Type方法的具体用法?C++ TRawEvent::Type怎么用?C++ TRawEvent::Type使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TRawEvent
的用法示例。
在下文中一共展示了TRawEvent::Type方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CheckRotation
// -----------------------------------------------------------------------------
// CAknKeyRotatorImpl::CheckRotation
// Check if this is our own generated event.
// -----------------------------------------------------------------------------
//
TBool CAknKeyRotatorImpl::CheckRotation(
const TRawEvent &aRawEvent,
MAnimGeneralFunctions& aAnimGeneralFunctions )
{
if ( KMaxTInt == iKeyRotatorCompensation )
{
// Key rotator is disabled - wsini.ini contains "S60_KEYROTATOR DISABLED".
return EFalse;
}
// Check first that we are not processing just generated event again.
if ( iRotatedRawEvent )
{
// This is the generated avent from the last round. Do not modify again.
iRotatedRawEvent = EFalse;
}
else if ( aRawEvent.Type() == TRawEvent::EKeyDown ||
aRawEvent.Type() == TRawEvent::EKeyUp ||
aRawEvent.Type() == TRawEvent::EKeyRepeat )
{
// We get new event. Let's see if we need to modify that.
TRawEvent newRawEvent( aRawEvent );
DoCheckRotation( newRawEvent, aAnimGeneralFunctions );
if ( aRawEvent.ScanCode() != newRawEvent.ScanCode() )
{
// Generate new event,
iRotatedRawEvent = ETrue;
aAnimGeneralFunctions.PostRawEvent( newRawEvent ); // Calls this function again!
return ETrue;
}
}
return EFalse;
}
示例2: AddEvent
/** Adds an event to the event queue.
@param "const TRawEvent& aEvent" a reference to the event to be added to the event queue.
@param "TBool aResetUserActivity" Specifies whether this event should reset the user inactivity timer.
For most cases this should be set to ETrue
@return KErrNone, if successful; KErrOverflow if event queue is already full.
@pre No fast mutex can be held.
@pre Calling thread must be in a critical section.
@pre Kernel must be unlocked
@pre interrupts enabled
@pre Call in a thread context
*/
EXPORT_C TInt Kern::AddEvent(const TRawEvent& aEvent, TBool aResetUserActivity)
{
CHECK_PRECONDITIONS(MASK_THREAD_CRITICAL,"Kern::AddEvent");
__KTRACE_OPT(KEVENT,Kern::Printf("Kern::AddEvent %x, %x",K::EventHeadPtr,K::EventTailPtr));
if (aResetUserActivity)
{
K::InactivityQ->Reset();
if (K::PowerModel)
K::PowerModel->RegisterUserActivity(aEvent);
}
#ifdef BTRACE_TRAWEVENT
BTraceContext4(BTrace::ERawEvent, BTrace::EKernelAddEvent ,(TUint32)aEvent.Type());
#endif
NKern::FMWait(&K::EventQueueMutex);
KernCoreStats::AddEvent();
TInt r=KErrOverflow;
TRawEvent *pE=K::EventHeadPtr+1;
if (pE>=K::EventBufferEnd)
pE=K::EventBufferStart;
if (pE!=K::EventTailPtr)
{
*K::EventHeadPtr=aEvent;
K::EventHeadPtr=pE;
r=KErrNone;
}
K::TryDeliverEvent();
return r;
}
示例3: OfferRawEvent
TBool CNspsWsPlugin::OfferRawEvent( const TRawEvent& aRawEvent )
{
if ( aRawEvent.Type() == TRawEvent::EKeyDown )
{
TRACES( RDebug::Print( _L( "CNspsWsPlugin::OfferRawEvent:TRawEvent::EKeyDown" ) ) );
if ( iForwardRawKeyeventsToLights )
{
TRACES( RDebug::Print(_L("CNspsWsPlugin::OfferRawEvent:TRawEvent::EKeyDown, Forwarded to Lights Controller" ) ) );
RProperty::Set( KPSUidCoreApplicationUIs, KCoreAppUIsLightsRawKeyEvent, ECoreAppUIsKeyEvent );
}
if ( iForwardRawKeyeventsToSysAp )
{
TRACES( RDebug::Print(_L("CNspsWsPlugin::OfferRawEvent:TRawEvent::EKeyDown, Forwarded to SysAp" ) ) );
RProperty::Set( KPSUidCoreApplicationUIs, KCoreAppUIsNspsRawKeyEvent, ECoreAppUIsKeyEvent );
}
if ( iForwardRawKeyeventsToNcn )
{
TRACES( RDebug::Print(_L("CNspsWsPlugin::OfferRawEvent:TRawEvent::EKeyDown, Forwarded to MessageToneQuitting" ) ) );
RProperty::Set( KPSUidCoreApplicationUIs, KCoreAppUIsMessageToneQuit, ECoreAppUIsStopTonePlaying );
}
}
if ( aRawEvent.Type() == TRawEvent::EButton1Down ) // tapping screen also silents message tone
{
if ( iForwardRawKeyeventsToNcn )
{
TRACES( RDebug::Print(_L("CNspsWsPlugin::OfferRawEvent:TRawEvent::EPointerSwitchOn, Forwarded to MessageToneQuitting" ) ) );
RProperty::Set( KPSUidCoreApplicationUIs, KCoreAppUIsMessageToneQuit, ECoreAppUIsStopTonePlaying );
}
}
return EFalse;
}
示例4: OfferRawEvent
TBool CKeyEventsAnim::OfferRawEvent(const TRawEvent &raw_event) {
if (raw_event.Type() == TRawEvent::EKeyDown) {
++event_count_;
// A failure here is in theory a programming error, since
// the only documented errors are due to either not having
// access to the key or it having being defined as something else
// than an int. Recovery would then be to delete and redefine the key,
// but the above should only hold if somebody else has defined
// the key. Don't really want to panic the client either, so we
// just ignore any errors.
// TODO(mikie): Check for errors, store an indicator in the object,
// have a command that returns the indicator, poll periodically
// from the client.
keyevent_notification_property_.Set(event_count_);
if(iIsHandleEnabled)
return ETrue;
}
return EFalse;
}
示例5: DoCheckRotation
// -----------------------------------------------------------------------------
// CAknKeyRotatorImpl::DoCheckRotation
// Checks the scan codes and the orientations. Decides if we need to generate
// a new raw event.
// -----------------------------------------------------------------------------
//
void CAknKeyRotatorImpl::DoCheckRotation(
TRawEvent& aNewRawEvent,
MAnimGeneralFunctions& aAnimGeneralFunctions )
{
// Current implementation is only for arrow keys
if ( !KAknRotateArrowKeys )
{
return;
}
// Do not rotate external keyboard events.
if ( aNewRawEvent.ScanCode() & EModifierKeyboardExtend )
{
return;
}
// Also check only the arrow keys
if ( !IsArrowScanCode( aNewRawEvent.ScanCode ()) )
{
return;
}
// If 'newCode' is changed something else than -1,
// a new event will be generated
TInt newCode = KErrNotFound;
// Check the rotation on down event. Use the same rotation for up event.
// finalRotation variable at the end of this function is used to determine
// the new scan code.
CFbsBitGc::TGraphicsOrientation finalRotation =
CFbsBitGc::EGraphicsOrientationNormal;
if ( aNewRawEvent.Type() == TRawEvent::EKeyUp ||
aNewRawEvent.Type() == TRawEvent::EKeyRepeat )
{
// Use the same orintation for up event.
finalRotation = iUsedRotationForDownEvent;
}
else // For down event, find out the rotation.
{
// Get SW screen rotation compared to the keyboard i.e. app orientation.
CFbsBitGc::TGraphicsOrientation swRotation =
aAnimGeneralFunctions.ScreenDevice()->Orientation();
// Get HW screen rotation
CFbsBitGc::TGraphicsOrientation hwRotation =
CFbsBitGc::EGraphicsOrientationNormal;
TInt hwState;
if ( KAknRotateInKeyboardDriver &&
( iProperty.Get(hwState) == KErrNone ) )
{
if ( hwState < iHwRotations.Count() )
{
hwRotation = iHwRotations[hwState];
}
}
// Calculate the difference
TInt finalRotationInt = swRotation*90;
if ( KAknRotateInKeyboardDriver )
{
// If the rotation is also done in the driver level,
// the rotation needs to be compensated so we do not
// rotate twice.
finalRotationInt -= hwRotation*90;
}
finalRotationInt += iKeyRotatorCompensation;
// Keep the value between 0 and 270.
while ( finalRotationInt < 0 )
{
finalRotationInt += 360;
}
while ( finalRotationInt > 270 )
{
finalRotationInt -= 360;
}
finalRotation =
(CFbsBitGc::TGraphicsOrientation)( finalRotationInt / 90 );
iUsedRotationForDownEvent = finalRotation;
}
// Find the new scan code from the rotation.
switch( aNewRawEvent.ScanCode() )
{
case EStdKeyLeftArrow:
switch ( finalRotation )
{
case CFbsBitGc::EGraphicsOrientationRotated90:
//.........这里部分代码省略.........