Jump to content

Default handling of end and power keys when using GAPI?


Guest jwicks

Recommended Posts

Hi,

I am using GAPI's GxOpenInput() call to grab all of the key events. Unfortunately, I want to consume all key events, except the ones for the end and power key. I want those two keys to have the default shell behavior. Is there a way to 'repost' these to the shell, or to some how get them to perform their default behavior even when using GAPI?

Thanks,

Jon

Link to comment
Share on other sites

by the End key I'm guessing you mean the 'back' button or the 'end call' button

if you want that to quit the app, then just code it to do so

same goes for the power button really

on the C500 be aware that GAPI does not trap the camera button or the home key being held down

Link to comment
Share on other sites

Right, by the 'end' key I mean the 'end call' key.

I know that I could just call SetForegroundWindow() with these keys but their behavior when processed by the shell is different:

1. The end key

a. When in a call - ends the phone call and does not background the window.

b. When not in a call - backgrounds the window.

2. The power key

a. When pressed and released quickly - brings up the 'quick app' screen.

b. When pressed and held - shuts the phone off.

I want to be able perform these same actions. I suppose there are two routes, one would be if I could somehow have the shell handle them, the other would be to try and simulate all of this myself. Either way I am not sure how to accomplish all of these actions (ending a call, bringing up quick app list, shutting off phone).

Link to comment
Share on other sites

you can 'minimise' the app and restore it when you want to, and tell gapi to stop updating or start again

GXResume();

GXSuspend();

at the end of the day if you are trying to simulate these things you need to decide if it's more important for you to write simulating code, or else minimise or even close the gapi program on certain keypresses

Link to comment
Share on other sites

I've seen that Interstellar Flames is correctly handling these keys even though they use GAPI. So I know it's possible. I was just wondering if anyone knew how they accomplished it.

Link to comment
Share on other sites

They must be using GxOpenInput() since the have overridden the default behavior of the back key, and have prevented the MS applications like the "Record" app from popping up. Is there any other way to achieve this without using GxOpenInput?

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.