When the user presses a button, Keyboard Hardware generates an interrupt, captured by Keyboard Driver, and decomposes the key code of this button event, then Driver sends it to a thread of the system - called Window Server, WINDOW Server will turn it in that application that is focused in Window Group, which is done using a Control Environment (CONE), which is an API function between Window Server and User Interface Library.
From the API function, you can see this processing process When Windows Server sends a button, the HandleWseventl () in the app is called, and the handleWseventL () method first calls ccoecontrol :: offerkeyEventL () If OfferKeyEvent () Back EkeywasNotconsuMed Continue call APPUI HandleKeyEventL (). Returns EkeyWasconsuMed if OffkeyEventL () processes the event.
If you want to call HandleKeyEventl () can be invoked by Set EcoestackflagrefusesallKeys to call offerKeyEventL ().
3 EEVENTKEYDOWN, 2 EEVENTKEYUP, 3 EEventKeyDown; you can get event types from Atype in OfferKeyEventl (Const TKeyEvent & Akeyevent, TEVENTCODE ATYPE). AkeyEvent is a struct to get more attributes of the button, EG: iCode Name Which key (key name is in e32keys.h) IREPEATS can determine whether it is a repeated button or a long button. If you want to change the button repetition rate of the system, you can set it through the RWSSession setKeyboardRepetrate method.
S60 mobile phones cannot accept continuous buttons by default, and only the keys pressed first can be accepted (that is, the button implicit, the power button, and the editing key are not a key implicit plug). Key block can be canceled by the setkeyblockmode () method in the Caknappui provided by S60.