我们知道在symbian的按键事件处理中使用以下方法:
tkeyresponse cmegajoycontainer::offerkeyeventl(const tkeyevent& akeyevent, teventcode atype)
这个方法是在ccoecontrol(control base class from which all other controls are derived)中定义的虚函数,其定义如下:
offerkeyeventl()virtual tkeyresponse offerkeyeventl(const tkeyevent& akeyevent,teventcode atype);
description
handles key events.
if a control wishes to process key events, it should implement this function. the implementation must ensure that the function returns
ekeywasnotconsumed
if it does not do anything in response to a key event — otherwise, other controls or dialogs may be prevented from receiving the key event. if it is able to process the event it should return
ekeywasconsumed
.
注释:
如果一个控件希望处理按键事件,那么它就应该实现这个函数。如果对一个按键事件,控件并没做任何事情,那么函数的实现中必须确保函数返回ekeywasnotconsumed。否则,(控件栈中的)其它控件或对话框可能会接收不到按键事件。如果此控件能够处理按键事件,那么它应该返回ekeywasconsumed。
when a key event occurs, the control framework calls this function for each control on the control stack, until one of them can process the key event (and returns
ekeywasconsumed
).
注释:
当一个按键事件发生时,控件框架调用控件栈上的每个控件的offerkeyeventl方法,直到它们中的一个能够处理这个按键事件(并且返回ekeywasconsumed)。
如果喜欢symbian中的iscancode和icode请收藏或告诉您的好朋友.
阅读(128) | 评论(0) | 转发(0) |