How do I set Flip Insensitive Mode?

Announcements and discussion for PInvoke

Moderators: Luke Jefferson, Robert

How do I set Flip Insensitive Mode?

Postby Smartphone_newbie » Tue Feb 12, 2008 12:57 am

I am developing a program for a Motorola MPX200 flip phone running Windows Mobile 2003. My intent is to use the Volume Up/Down buttons as input to the program while the flip is closed.

My program works fine while the flip is open, but all of the external buttons are disabled when the flip is closed. I have heard about a mysterious application attribute called "Flip Insensitive = True" but I can't find any documentation on how to set this attribute. Does anyone know how to do this?

Another question: I use GXOpenInput() to enable the key press events to trap directly to my program [gx.dll]. It works great. When I press Volume UP I get an F6 event. BUT - If I press and hold Volume Up the phone automatically goes into Voice Recognition mode.

Does anyone know how to completely disable the system functions of the outside buttons on the phone?
Smartphone_newbie
 
Posts: 2
Joined: Tue Feb 12, 2008 12:44 am

Postby Smartphone_newbie » Wed Feb 13, 2008 1:17 am

Here is an update:

Actually, the buttons do work (kind of), but the speaker on the phone is automatically turned off. When I press a button, I want to play a sound file (and/or vibrate the phone). It plays over the normal phone speaker when the flip is opened, but you have to plug in the headset to hear it when the flip is closed. Also, I can control the vibrator when the flip is open, but not when closed. But, at least the volume button events are being honored when the flip is closed.

I'm still having the issue with the press & hold. This doesn't generate any key up/down/press event. What is funny is that when I debug using the Smartphone emulator it does generate an event on a press & hold. This must be something peculiar with the MPX220 implementation. If you press and hold the volume buttons, the O/S automatically swallows the event (or, at least I can't figure out how to get it).

I would also expect the camera button to be available once I perform a GXOpenInput(), but this button is also swallowed by the MPX220 O/S.

One interesting note to those who might want to do a similar thing: In your main program, what you must do is just call GXOpenInput(), put in the code to trap the key events for the form, and then start a new thread with the logic to actually do what you want to do. The event code in the main thread will be triggered on a key press, and the code can set public static variables recognized by the logic thread. The trick in the logic thread is to be in a loop where you check the public variables for event flags set by the event code, and then sleep (I sleep for 10 ms before polling the variables again).

I tried to do this in one thread by using the Thread.sleep() routine in the main thread, but it doesn't work. While the thread is sleeping it can't process the key events.

If anyone has some insight into the press & hold issue, using the vibrator when the flip is closed, or how I can gain control of the camera button, please let me know.

Thanks,
-Newbie
Smartphone_newbie
 
Posts: 2
Joined: Tue Feb 12, 2008 12:44 am


Return to PInvoke.Net

Who is online

Users browsing this forum: No registered users and 0 guests