×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    May 2010
    Location
    Egypt
    Posts
    433

    Question Stop sound when user press any button

    In my application I play a sound and I want to stop this sound when user touches any button , Is there a wait for activity function that can help ?




    Many thanks in advance.

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,567

    Re: Stop sound when user press any button

    If your application is in the foreground, OfferKeyEventL and HandleKeyEventL are the obvious candidates for detecting user activity on the keyboard/keypad. For touch screen events, HandlePointerEventL is the handler.

  3. #3
    Registered User
    Join Date
    May 2010
    Location
    Egypt
    Posts
    433

    Re: Stop sound when user press any button

    And what if the application in the background ?

  4. #4
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,567

    Re: Stop sound when user press any button

    There comes the hard part, with key capturing and other mystical things.
    While there are timer functions for inactivity (RTimer::Inactivity and its wrappers), I am not aware of anything for detecting activity. Though it may easily happen that there is a simple P&S key for this purpose (it may be worth some digging into the source, it is/will be available via http://symbian.nokia.com)
    For a single solution, which works everywhere, it is possible to check User::InactivityTime from a periodic timer with a short period. If InactivityTime is less than it was in the last call, that means user activity. Unfortunately it is a polling approach, and it will always have some delay.

  5. #5
    Registered User
    Join Date
    May 2010
    Location
    Egypt
    Posts
    433

    Re: Stop sound when user press any button

    Many thanks wizard_hu_ for your consistent help, I found a Wiki Detecting user inactivity in Symbian OS that uses Active Object with RTimer::Inactivity to notify me when there is a user activity.

    Best Regards: MrAlshahawy

Similar Threads

  1. Replies: 14
    Last Post: 2009-11-16, 13:16
  2. Detroy app when user press hang up button (red button)
    By ammanage in forum Mobile Java General
    Replies: 9
    Last Post: 2009-09-21, 19:29
  3. Detect a key press to stop the sound playing
    By heuven in forum Symbian C++
    Replies: 1
    Last Post: 2009-04-06, 18:25
  4. Replies: 0
    Last Post: 2003-12-10, 06:31
  5. button sound is stop background sound...
    By crony94 in forum Mobile Java General
    Replies: 0
    Last Post: 2003-02-17, 06:46

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •