event autolock the keypad ???
Hi! I will works in carbide c++ and my app is for s60v5 (touch celphone)
I want know when the cellphone does autolock the keypad.
I was try capturing all handler events , but auto keypad lock don't make events !!!!
my app is in background or foreground , I try to make an un lock application =)
is there any better method?
please help!
Thank you in advance
Re: event autolock the keypad ???
I do not think there exists any direct way to monitor the same, but a workaround is still there which you can try :
[url]http://www.developer.nokia.com/Community/Wiki/Detecting_keypad_lock/unlock_status[/url]
Re: event autolock the keypad ???
Hello,
this is just an idea, never tried, but in avkondomainpskeys.h you can find definition of KAknKeyguardStatus:
[CODE]
const TUid KPSUidAvkonDomain = { 0x10207218 }; // Same as KPSUidAvkonInternal
/**
* Indicates the status of Keyguard
*
* Possible values are:
*
* 0: Keyguard is not active
* 1: Keys are locked
* 2: Autolock emulation enabled
*
*/
const TUint32 KAknKeyguardStatus = 0x00000001;
enum TAknKeyguardStatus
{
EKeyguardNotActive,
EKeyguardLocked,
EKeyguardAutolockEmulation
};
[/CODE]
since it's a P&S key, you could try to Register for notification of changes to a property:
[url]http://www.developer.nokia.com/Community/Wiki/Publish_and_Subscribe[/url]
[url]http://www.developer.nokia.com/Community/Wiki/Using_RProperty_for_subscribing[/url]
let us know if it works...
regards
pg
Re: event autolock the keypad ???
thanks for the response!!
pavarang :
i don't know where is that library avkondomainpskeys.h . my carbide c++ 2.7 with S60_5th_SDK_ASP_v1.0.1 can't find that library. which lib I must import??
I thinking in your idea , I think with subscribe to the "keys locked note" that says (use unlock button for unlock screen device) could me save a lot of work.
some one know how I can do it?
Re: event autolock the keypad ???
thanks pavarang!!
I was tried this code and it can be work well. the values for ".GetFocusWindowGroup();" for S60v5 are different, nothing major. but I think that code can be useful for my proyect =) .
Re: event autolock the keypad ???
Basically, you don't need to have the avkondomainpskeys.h, since the information you would need is presented in the post, so you would simply need to listen to that property.
For GetFocusWindowGroup(), I actually do not see any point on checking it, it should be enough to simply monitor focus changes, and once focus change happens, you check whether the keypad is locked. And if it is, then you just got keyloack event. If it is not, then something else just got the focus.
Re: event autolock the keypad ???
[QUOTE=symbianyucca;912147]Basically, you don't need to have the avkondomainpskeys.h, since the information you would need is presented in the post, so you would simply need to listen to that property.
[/QUOTE]
symbianyucca already replied, but just to be sure that you grabbed the idea:
just copy the snippet i took from avkondomainpskeys.h into your code (post #3 above)
then, use code from wiki article: [url]http://www.developer.nokia.com/Community/Wiki/Using_RProperty_for_subscribing[/url]
and use KPSUidAvkonDomain as uid, and KAknKeyguardStatus as key when you call RProperty::Attach()
when the value of the key changes, RunL() is called, and there you can check its value with RProperty::Get()
if you get an error like -46, maybe ReadDeviceData capability is required
I'm sorry you have to check and experiment for yourself what happens on your devices...
otherwise use the first suggestion from vineet, explained by symbianyucca too
regards
pg
Re: event autolock the keypad ???
in Addition to the PS-key usage. You MUST understand that when using an API which is not included in the public SDK, you would indeed be using an API which has no compatibility promise whatsoever. This efectively means that, if you want to be sure it works ok, you would need to test it with all devices you are thinking of supporting, as well as there could be breaks in usage even within firmware versions.
Anyway, that said, these things often do work just fine, anyway, you should be ready for suprises as well.
Re: event autolock the keypad ???
thanks to all!!
finally I use the propouse of vineet.jain and handler of keypad event, and works well for my proyect