×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 28
  1. #1
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    115

    Question How can I lock my keypad?

    Before you say "do a search", I have! Several infact and came up with use Keypress or pykeylock or misty but no code example or anything of how to code it. All I want to do is lock my keypad and then be able to unlock it again. Any ideas? Thanx

  2. #2
    Regular Contributor
    Join Date
    Dec 2007
    Location
    India
    Posts
    133

    Re: How can I lock my keypad?

    Quote Originally Posted by Dansco View Post
    Before you say "do a search", I have! Several infact and came up with use Keypress or pykeylock or misty but no code example or anything of how to code it. All I want to do is lock my keypad and then be able to unlock it again. Any ideas? Thanx
    Hi,

    Pehaps you didn't search properly,
    Have a llok at this discussion

    Also I have added this to the Wiki for further reference.
    http://wiki.forum.nokia.com/index.ph..._unlock_keypad

    Hopefully helps.
    Kandyfloss

    V 7.0642.0
    18-10-06
    RH-51
    Nokia 7610

  3. #3
    Registered User
    Join Date
    Dec 2007
    Posts
    47

    Re: How can I lock my keypad?

    Thanks, but misty for only 3rd edition only,please provide solution for 2nd edition device...........
    i need urgently keypad lock ,unlock for 2nd edition device through programmetically........

    Thanks & Regards
    Elumalai

  4. #4
    Regular Contributor
    Join Date
    Dec 2007
    Location
    India
    Posts
    133

    Re: How can I lock my keypad?

    Quote Originally Posted by sevenhills View Post
    Thanks, but misty for only 3rd edition only,please provide solution for 2nd edition device...........
    i need urgently keypad lock ,unlock for 2nd edition device through programmetically........

    Thanks & Regards
    Elumalai
    I think Cyke64 has given you a solution here for 2nd Edition devices.
    Kandyfloss

    V 7.0642.0
    18-10-06
    RH-51
    Nokia 7610

  5. #5
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    115

    Re: How can I lock my keypad?

    Quote Originally Posted by kandyfloss View Post
    Hi,

    Pehaps you didn't search properly,
    Have a llok at this discussion

    Also I have added this to the Wiki for further reference.
    http://wiki.forum.nokia.com/index.ph..._unlock_keypad

    Hopefully helps.
    Thanx for the link mate but I've tried that and it tells me that the "NameError: global name 'lock_keypad' is not defined Any ideas?

  6. #6
    Super Contributor
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471

    Re: How can I lock my keypad?

    Quote Originally Posted by Dansco View Post
    Thanx for the link mate but I've tried that and it tells me that the "NameError: global name 'lock_keypad' is not defined Any ideas?
    The problem has to do with the way "misty" was imported.
    Code:
    #First solution
    
    import misty
    
    from e32 import ao_sleep as sleep
     
    #Locks the Keypad
    misty.lock_keypad()
    sleep(10)
    misty.lock_keypad_silent()
    Or...
    Code:
    #Second solution
    
    from misty import *
    from e32 import ao_sleep as sleep
     
    #Locks the Keypad
    lock_keypad()
    sleep(10)
    lock_keypad_silent()
    I've corrected the wiki article.

  7. #7
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    115

    Re: How can I lock my keypad?

    Quote Originally Posted by bogdan.galiceanu View Post
    The problem has to do with the way "misty" was imported.
    Code:
    #First solution
    
    import misty
    
    from e32 import ao_sleep as sleep
     
    #Locks the Keypad
    misty.lock_keypad()
    sleep(10)
    misty.lock_keypad_silent()
    Or...
    Code:
    #Second solution
    
    from misty import *
    from e32 import ao_sleep as sleep
     
    #Locks the Keypad
    lock_keypad()
    sleep(10)
    lock_keypad_silent()
    I've corrected the wiki article.
    Cheers for the help mate but the first example gives the same error and the 2nd one says 'lock_keypad' is not defined

  8. #8
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: How can I lock my keypad?

    hi dansco
    really sorry for asking such a stupid question have you installed misty as the lib module.

  9. #9
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    115

    Re: How can I lock my keypad?

    Quote Originally Posted by gaba88 View Post
    hi dansco
    really sorry for asking such a stupid question have you installed misty as the lib module.
    You mean copying misty.pyd to C:\System\Libs right?

  10. #10
    Super Contributor
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471

    Re: How can I lock my keypad?

    Quote Originally Posted by Dansco View Post
    You mean copying misty.pyd to C:\System\Libs right?
    Actually, there's a bit more to it than that. See here (look under the subtitle "3rd edition")

    EDIT: I forgot to ask, what S60 edition phone are you doing this for?

  11. #11
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    115

    Re: How can I lock my keypad?

    Quote Originally Posted by bogdan.galiceanu View Post
    Actually, there's a bit more to it than that. See here (look under the subtitle "3rd edition")

    EDIT: I forgot to ask, what S60 edition phone are you doing this for?
    Thanx mate. I'm reading it now.

    Yeah sorry I have a N95 3rd Edition

  12. #12
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    115

    Re: How can I lock my keypad?

    I've used a copy of python with only misty installed and get the same errors for both examples Any ideas?

  13. #13
    Super Contributor
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471

    Re: How can I lock my keypad?

    You're right. I used
    Code:
    dir(misty)
    to see the functions is has and there was no "lock_keypad".

    As an alternative, and you should only use this if you really, really need to prevent the user from pressing the keys, I would say you create a loop that listens to keypresses. Something like this:
    Code:
    import appuifw
    from key_codes import *
    
    #Insert the keyboard class from "Method 2" here: http://wiki.forum.nokia.com/index.php/How_to_handle_keypress_easily 
    
    running=1
    while(running==1):
        for i in #list of scancodes except the unlock sequence goes here
           if(keyboard.pressed(i)):appuifw.note(u"Unlock first", "info")
    But this will drain your battery in a few hours or less. Best wait for an appropriate extension, or simulate pressing the lock/unlock sequence using Cyke64's keypress module.
    Last edited by bogdan.galiceanu; 2008-04-28 at 16:11.

  14. #14
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    115

    Re: How can I lock my keypad?

    Quote Originally Posted by bogdan.galiceanu View Post
    You're right. I used
    Code:
    dir(misty)
    to see the functions is has and there was no "lock_keypad".
    I thought I was going mad then. So what alternatives do we have?

  15. #15
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    115

    Re: How can I lock my keypad?

    Will give it a try mate but all I'm trying to do is use the sensor to lock and unlock my keypad. I have a N95 and am trying to develop certain functions for it.

    I was trying to use keypress to lock it but I can't get leftselect and * or powerbutton and down and select?!

Similar Threads

  1. Keypad lock on N-70 device
    By stratocumuls in forum General Development Questions
    Replies: 8
    Last Post: 2007-10-30, 13:08
  2. [6288] Keypad lock bug
    By WarrenFaith in forum General Development Questions
    Replies: 0
    Last Post: 2007-09-13, 10:10
  3. How to lock keypad?
    By liangshu8404 in forum Symbian
    Replies: 4
    Last Post: 2007-08-15, 17:23
  4. E60 - timer option on keypad lock requested
    By kja2615 in forum Series 40 & S60 Platform Feedback Archive
    Replies: 0
    Last Post: 2006-11-16, 05:51
  5. Keypad Lock on 6600
    By AndyCr6600 in forum General Development Questions
    Replies: 3
    Last Post: 2004-01-09, 13:24

Posting Permissions

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