×

Discussion Board

Results 1 to 6 of 6

Thread: Left Softkey

  1. #1
    Regular Contributor
    Join Date
    Mar 2008
    Posts
    57

    Left Softkey

    Why I can't detect if left softkey is clicked just like other keys?

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

    Re: Left Softkey

    I think you can, using the keycapture module. See this thread (although rather old) for a discussion about it.

    Here's an example:
    Code:
    import keycapture, appuifw, e32
    
    
    def cb_capture(key):
    	if(key==keycapture.EKeyLeftSoftkey):
    		print "Left softkey pressed"
    	elif(key==keycapture.EKeyRightSoftkey):
    		print "Right softkey pressed"
    		capturer.stop()
    		app_lock.signal()
    
    capturer=keycapture.KeyCapturer(cb_capture)
    capturer.keys=([keycapture.EKeyLeftSoftkey, keycapture.EKeyRightSoftkey])
    
    capturer.start()
    
    app_lock=e32.Ao_lock()
    app_lock.wait()
    Last edited by bogdan.galiceanu; 2009-01-02 at 11:41.

  3. #3
    Registered User
    Join Date
    Feb 2008
    Location
    Moscow Russia
    Posts
    25

    Re: Left Softkey

    There is no it intercepts pressing and in the menu though so it will turn out very much it will be not convenient. Here so I do
    Code:
    import appuifw,e32,graphics
    body=graphics.Image.new((176,208))
    def keys(x):
     if x['type']==3:
      if x['scancode']==164:
       body.text((50,80),u'button pressed',0x0000ff,font=u'Alb17b')
       canvas.blit(body)
    appuifw.app.body=canvas=appuifw.Canvas(event_callback=keys)
    body.clear(0xff0000)
    canvas.blit(body)
    e32.Ao_lock().wait()
    It is the best variant but it is necessary to work with graphics

  4. #4
    Regular Contributor
    Join Date
    Mar 2008
    Posts
    57

    Re: Left Softkey

    Thank you so much bogdan.galiceanu and Versoul. Versoul's solution is perfect for me.

  5. #5
    Regular Contributor
    Join Date
    Mar 2008
    Posts
    57

    Re: Left Softkey

    BTW is that x['type']==3 same as x['type']==appuifw.EEventKey ?

  6. #6
    Registered User
    Join Date
    Feb 2008
    Location
    Moscow Russia
    Posts
    25

    Re: Left Softkey

    DrivingMobileInnovation: its mean x['type']==appuifw.EEventKeyDown
    Without it the code of function will be called out 2 times by pressing and unpressing key

    EEventKey = 1
    EEventKeyUp = 2
    Last edited by Versoul; 2008-06-20 at 21:43.

Similar Threads

  1. Left softkey on top (landscape mode)
    By WinHw in forum Symbian User Interface
    Replies: 3
    Last Post: 2008-05-14, 05:55
  2. Replies: 2
    Last Post: 2007-10-18, 01:19
  3. Displaying OK command directly on left softkey
    By simonru in forum Mobile Java General
    Replies: 5
    Last Post: 2005-09-07, 03:17
  4. KeyCode for LEFT - and RIGHT Softkey?
    By rollli in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2003-11-04, 06:41
  5. Replies: 1
    Last Post: 2002-10-21, 06:04

Posting Permissions

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