<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://www.newlc.com" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>NewLC - HandleKeyEventL not hiting - Comments</title>
 <link>http://www.newlc.com/en/topic-16547</link>
 <description>Comments for &quot;HandleKeyEventL not hiting&quot;</description>
 <language>en</language>
<item>
 <title>How to Display  A  message when  a key is pressed  </title>
 <link>http://www.newlc.com/en/topic-16547#comment-46606</link>
 <description>&lt;p&gt;Hi&lt;/p&gt;

&lt;p&gt;i am new to symbian os so any body will help me to write a program that will display a message when i pressed a key ..&lt;/p&gt;

&lt;p&gt;PLZ   reply   ASAP &lt;/p&gt;</description>
 <pubDate>Wed, 28 May 2008 14:16:54 +0200</pubDate>
 <dc:creator>viraltech</dc:creator>
 <guid isPermaLink="false">comment 46606 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: HandleKeyEventL not hiting</title>
 <link>http://www.newlc.com/en/topic-16547#comment-35564</link>
 <description>&lt;div class=&quot;smf-content&quot;&gt;Hi vin2ktalks,&lt;br /&gt;&amp;nbsp; I am developing for 6600,6630 and I am using version 7 series60 2nd edition.&amp;nbsp; I can consumed the key event in OfferKeyEventL() but in my application I have 10 views. So, for hotkey I want to make my code generic so that I can consume hotkey event in HandleKeyEventL() instead of consuming in OfferKeyEventL of all the containers.&lt;br /&gt;Thanks&lt;br /&gt;mos&lt;/div&gt;</description>
 <pubDate>Tue, 31 Oct 2006 09:46:49 +0100</pubDate>
 <dc:creator>mos13</dc:creator>
 <guid isPermaLink="false">comment 35564 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: HandleKeyEventL not hiting</title>
 <link>http://www.newlc.com/en/topic-16547#comment-35563</link>
 <description>&lt;div class=&quot;smf-content&quot;&gt;Generally by over-riding the OfferKeyEventL() from the CCoeControl to your control class you can trap the key presses(for that your application should be on foreground). I did that and worked for me. I never over-ridded HandleWsEventL() and HandleKeyEventL() into my AppUi class in that cases.&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;quoteheader&quot;&gt;Quote from: mos13&lt;/div&gt;&lt;div class=&quot;quote&quot;&gt;...&lt;br /&gt;{&lt;br /&gt;Â  Â  Â  if(aKeyEvent.iScanCode == 56) // When I press &lt;span style=&quot;color: Red;&quot;&gt;&amp;#039;t&amp;#039;&lt;/span&gt;&lt;br /&gt;Â  Â  Â  Â  return EKeyWasNotConsumed;&lt;br /&gt;}&lt;br /&gt;...&lt;/div&gt;&lt;br /&gt;For which device are you developing the application?&lt;/div&gt;</description>
 <pubDate>Tue, 31 Oct 2006 08:44:30 +0100</pubDate>
 <dc:creator>vin2ktalks</dc:creator>
 <guid isPermaLink="false">comment 35563 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: HandleKeyEventL not hiting</title>
 <link>http://www.newlc.com/en/topic-16547#comment-35562</link>
 <description>&lt;div class=&quot;smf-content&quot;&gt;Hi,&lt;br /&gt;&amp;nbsp; Just want to add one more point.&lt;br /&gt;My application is based on SMS. So, once I click my application icon, the focus comes to HandleKeyEventL() through HandleWsEventL(); but after receiveing the Loggin message from the server(running on differrent system) the focus is not coming to my HandleKeyEventL().&lt;br /&gt;&lt;br /&gt;thanks&lt;br /&gt;mos&lt;/div&gt;</description>
 <pubDate>Tue, 31 Oct 2006 08:18:45 +0100</pubDate>
 <dc:creator>mos13</dc:creator>
 <guid isPermaLink="false">comment 35562 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: HandleKeyEventL not hiting</title>
 <link>http://www.newlc.com/en/topic-16547#comment-35561</link>
 <description>&lt;div class=&quot;smf-content&quot;&gt;Hi Dip,&lt;br /&gt;&amp;nbsp; I override InputCapabilities() in my AppUi class but still focus is not coming in my HandleKeyEventL() function when I press any key and not comsuming key event anywhere.&lt;br /&gt;&lt;br /&gt;TCoeInputCapabilities CMyAppUi::InputCapabilities() const&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; return (TCoeInputCapabilities::EAllText | TCoeInputCapabilities::ENavigation);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Thanks&lt;br /&gt;mos&lt;/div&gt;</description>
 <pubDate>Tue, 31 Oct 2006 07:58:34 +0100</pubDate>
 <dc:creator>mos13</dc:creator>
 <guid isPermaLink="false">comment 35561 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: HandleKeyEventL not hiting</title>
 <link>http://www.newlc.com/en/topic-16547#comment-35560</link>
 <description>&lt;div class=&quot;smf-content&quot;&gt;Hi vin2ktalks,&lt;br /&gt;&amp;nbsp; yes, I created Listbox in my contianer class and also override method HandleListBoxEventL() in my container class.&lt;br /&gt;&lt;br /&gt;Thanks&lt;br /&gt;mos&lt;/div&gt;</description>
 <pubDate>Tue, 31 Oct 2006 07:41:47 +0100</pubDate>
 <dc:creator>mos13</dc:creator>
 <guid isPermaLink="false">comment 35560 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: HandleKeyEventL not hiting</title>
 <link>http://www.newlc.com/en/topic-16547#comment-35559</link>
 <description>&lt;div class=&quot;smf-content&quot;&gt;Have you created any controls in your CMyContainer class? Like list box or something?&lt;/div&gt;</description>
 <pubDate>Tue, 31 Oct 2006 07:15:47 +0100</pubDate>
 <dc:creator>vin2ktalks</dc:creator>
 <guid isPermaLink="false">comment 35559 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: HandleKeyEventL not hiting</title>
 <link>http://www.newlc.com/en/topic-16547#comment-35558</link>
 <description>&lt;div class=&quot;smf-content&quot;&gt;Hi vin2ktalks,&lt;br /&gt;As SDK documents says:&lt;br /&gt;&amp;gt;&amp;gt;For key events, it calls CCoeControl::OfferKeyEventL() for each &amp;gt;&amp;gt;control on the control stack, beginning with the control at the top &amp;gt;&amp;gt;(position 0) until a control consumes it. If no control on the stack &amp;gt;&amp;gt;consumes the key event, the app UI&amp;#039;s HandleKeyEventL() is &amp;gt;&amp;gt;called. &lt;br /&gt;&lt;br /&gt;I am also doing the same thing. I am not consuming the KeyEvent in my OfferKeyEventL(), as per document it should call my HandleKeyEventL().&lt;br /&gt;TKeyResponse CMyContainer::OfferKeyEventL( const TKeyEvent&amp;amp; aKeyEvent,TEventCode aType )&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; if(aKeyEvent.iScanCode == 56) // When I press &amp;#039;t&amp;#039;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return EKeyWasNotConsumed;&lt;br /&gt;}&lt;br /&gt;Thanks &lt;br /&gt;mos&lt;/div&gt;</description>
 <pubDate>Tue, 31 Oct 2006 07:00:47 +0100</pubDate>
 <dc:creator>mos13</dc:creator>
 <guid isPermaLink="false">comment 35558 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: HandleKeyEventL not hiting</title>
 <link>http://www.newlc.com/en/topic-16547#comment-35557</link>
 <description>&lt;div class=&quot;smf-content&quot;&gt;Hi mos13,&lt;br /&gt;&lt;br /&gt; As per document says, It is not recommenened to override &lt;br /&gt;&lt;br /&gt; HandleKeyEventL() in derived class.&lt;br /&gt;&lt;br /&gt;If you intended to override this function, you should also override InputCapabilities() virtual function, returning a TCoeInputCapabilities object whose attributes correspond to the behavior of the HandleKeyEventL() function.&lt;br /&gt;&lt;br /&gt;In the implementation of HandleWsEventL function , Pass the key event to window server.&lt;br /&gt;&lt;br /&gt; CEikAppUi::HandleWsEventL(aEvent,aDestination);&lt;br /&gt;&lt;br /&gt;May be it solves your problem.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;</description>
 <pubDate>Tue, 31 Oct 2006 06:53:33 +0100</pubDate>
 <dc:creator>dipakbaviskar2003</dc:creator>
 <guid isPermaLink="false">comment 35557 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: HandleKeyEventL not hiting</title>
 <link>http://www.newlc.com/en/topic-16547#comment-35556</link>
 <description>&lt;div class=&quot;smf-content&quot;&gt;The class/function definitions seem to be correct. But did you go through the SDK document for the function HandleWsEventL()?&lt;br /&gt;&lt;br /&gt;It says:&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;quoteheader&quot;&gt;Quote&lt;/div&gt;&lt;div class=&quot;quote&quot;&gt;&lt;b&gt;Description&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Handles events sent to the application by the window server.&lt;br /&gt;&lt;br /&gt;This function is called whenever the window server sends key or pointer events or some other special events to the application. It calls one of a number of functions, according to the type of event.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;For key events, it calls CCoeControl::OfferKeyEventL() for each control on the control stack, beginning with the control at the top (position 0) until a control consumes it. If no control on the stack consumes the key event, the app UI&amp;#039;s HandleKeyEventL() is called. Note that CCoeControl::OfferKeyEventL() is not called for controls whose ECoeStackFlagRefusesAllKeys flag is set.&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;...&lt;br /&gt;...&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;</description>
 <pubDate>Tue, 31 Oct 2006 06:35:16 +0100</pubDate>
 <dc:creator>vin2ktalks</dc:creator>
 <guid isPermaLink="false">comment 35556 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: HandleKeyEventL not hiting</title>
 <link>http://www.newlc.com/en/topic-16547#comment-35555</link>
 <description>&lt;div class=&quot;smf-content&quot;&gt;Thanks for your response.&lt;br /&gt;My appui class is derived from CAknViewAppUi while I have my view and container classes separately.&lt;br /&gt;&lt;br /&gt;class CMyAppUi : public CAknViewAppUi&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;&amp;nbsp; &amp;nbsp;void HandleWsEventL(const TWsEvent&amp;amp; aEvent,CCoeControl* aDestination);&lt;br /&gt;&lt;br /&gt;TKeyResponse HandleKeyEventL(const TKeyEvent&amp;amp; aKeyEvent,TEventCode aType);&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;class CMyView : public CAknView&lt;br /&gt;{&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;class CMyContainer : public CCoeControl, MCoeControlObserver&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;public: // From CoeControl&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TKeyResponse OfferKeyEventL( const TKeyEvent&amp;amp; aKeyEvent,TEventCode aType ); &lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;Thanks in advance.&lt;br /&gt;mos&lt;/div&gt;</description>
 <pubDate>Tue, 31 Oct 2006 05:52:15 +0100</pubDate>
 <dc:creator>mos13</dc:creator>
 <guid isPermaLink="false">comment 35555 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: HandleKeyEventL not hiting</title>
 <link>http://www.newlc.com/en/topic-16547#comment-35554</link>
 <description>&lt;div class=&quot;smf-content&quot;&gt;The functions HandleWsEventL() and HandleKeyEventL() are defined in class CCoeAppUi, while the function OfferKeyEventL() is defined in the class CCoeControl.&lt;br /&gt;&lt;br /&gt;Which class did you derive your class? Please give more details.&lt;br /&gt;&lt;/div&gt;</description>
 <pubDate>Tue, 31 Oct 2006 05:27:37 +0100</pubDate>
 <dc:creator>vin2ktalks</dc:creator>
 <guid isPermaLink="false">comment 35554 at http://www.newlc.com</guid>
</item>
<item>
 <title>HandleKeyEventL not hiting</title>
 <link>http://www.newlc.com/en/topic-16547</link>
 <description>&lt;div class=&quot;smf-content&quot;&gt;&lt;/div&gt;&lt;p&gt;&lt;a href=&quot;http://www.newlc.com/en/topic-16547&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.newlc.com/en/topic-16547#comments</comments>
 <category domain="http://www.newlc.com/en/forums/symbian-c">Symbian C++</category>
 <pubDate>Mon, 30 Oct 2006 20:59:08 +0100</pubDate>
 <dc:creator>mos13</dc:creator>
 <guid isPermaLink="false">16184 at http://www.newlc.com</guid>
</item>
</channel>
</rss>
