Monday, December 29, 2008

Key flows in Symbian OS (keypad)

Keypad Architecture and key Flow in Symbian OS


--->Symbian OS is open because updating new HW is very easy for example I will discuss about the keypad. How Symbian supports different vendor’s architecture. Symbian doesn’t know about how the third party keypad HW is going to work, because Kern’s class AddEvent() function is the bridge between the keypad and kernel. It’s quite interesting right?


--->It’s a simple formula used C++. That’s called modularity. While designing any type of application we will think about the input to the module and output of that module. This will reduce the maintenance change requirement time. I.e. changing the keypad HW doesn’t affect the kernel so no need to recompile the kernel. Now it’s time to explore, what is the output of keypad driver and what is the input to kernel keypad queue.





--->TRawEvent type is the output of the keypad PDD and input of the kernel. What TRawEvent contains? This object tells the event type which is generated by keypad. The kernel work is to dispatch this object to the window server. After that, kernel job is over. Window server has to take care to dispatch the event to the correct plug-in or application. It has to translate the key to identify the particular key. For example pressing the number key 2 continuously three times should result in displaying character “c”. Window server’s CKeyTranslator does this job.


--->Window server gets the TRawEvent from kernel, and it passes to all the plug-in which are all registered with window server. If no plug-ins are consumed the key events then it passes to the application. Passing the key events to the application is very easy because it will get the current focus window and window server passes to that application. Its just overall about the key flow architecture. Once you got interested in that just explore the code you will understand clearly….:-)




No comments: