We know that the following methods are used in Symbian key event handling:
Tkeyresponse cmegajoycontainer::offerkeyeventl (const tkeyevent& akeyevent, Teventcode aType)
This method is a virtual function defined in Ccoecontrol (Control base class from which all other controls are derived), which is defined as follows:
Offerkeyeventl () virtual Tkeyresponse offerkeyeventl (const tkeyevent& akeyevent,teventcode atype);
Description
Handles key events.
If a control is wishes to process key events, it should implement the This function. The implementation must ensure that function returns
Ekeywasnotconsumed
If it does does anything in response to a key event-otherwise, the other controls or dialogs May is prevented from Receivi Ng the key event. If it is able to process the event it should return
Ekeywasconsumed
.
Comments:
If a control wants to handle a key event, it should implement this function. If the control does nothing with a keystroke event, the function's implementation must ensure that the function returns to Ekeywasnotconsumed. Otherwise, other controls or dialog boxes (in the control stack) may not receive key events. If this control can handle key events, it should return ekeywasconsumed.
When a key event is occurs, the control framework calls this function for each control stack, until one of the M can process the key event (and returns
Ekeywasconsumed
).
Comments:
When a keystroke event occurs, the control framework invokes the Offerkeyeventl method of each control on the control stack until one of them can handle the key event (and return ekeywasconsumed).
Parameters
Const tkeyevent& Akeyevent
The key event.
Teventcode Atype
The type of key event:
Eeventkey
,
Eeventkeyup
Or
Eeventkeydown
.
return value
Tkeyresponse
Indicates whether or not the key event is used by this control.