Register
Site Login
Site Search
Forums
Advertisement
Welcome to PocketMatrix. PocketMatrix is dedicated to providing the best online community for mobile device developers and enthusiests. What's new?

[windows mobile] key event issue


[windows mobile] key event issue

Postby mamahow » Feb 18, 2009 @ 2:44pm

hi Edge,

1)
In some reason, we're trying to NOT use lockkey param in the main config
(ecd.maincfg->lockkeys = false;)
And handle all the key events in the OnNativeEvent().

What we want to catch is key - VK_TEND (end key).
But We can't receive WM_KEYDOWN and only WM_KEYUP along with VK_TEND.

Before WM_KEYUP is received, edge app will be pushed to background by pressing end key (VK_TEND)...
To prevent this, we want to handle the end key behavior by ourselves.

2)
and the 2nd question is how to dynamically change lockkey param.
It's also failed to make affective by using ecd.maincfg->lockkeys = false;

Can you tell me how to solve these problems?


Thanks,
mamahow
mamahow
pm Member
 
Posts: 17
Joined: Jul 1, 2008 @ 10:29am


Postby edge » Feb 19, 2009 @ 4:59pm

Hi Mamahow,

Currently it's not possible to use the VK_TEND key, it will probably be added to a later EDGELIB release.

For locking the keys in your application we recommend setting the lockkeys setting to false. Then you can handle the locking of keys yourself. Please refer to the Windows Mobile functions:
GXOpenInput/GXCloseInput
SHSetAppKeyWndAssoc

You can also try to return true in your OnNativeEvent callback function.
EDGELIB: Cross-platform mobile development at your fingertips
http://www.edgelib.com
User avatar
edge
pm Member
 
Posts: 1180
Joined: Aug 22, 2005 @ 3:42pm
Location: The Netherlands


Postby mamahow » Feb 23, 2009 @ 7:33am

Hi Edge,
After set lockkey to false then handle key event by us, such as

Code: Select all









10 
11 
12 
13 
14 
15 
16 
17 
18 
bool ClassMain::OnNativeEvent(ENATIVETYPE winhandle, ENATIVETYPE msg, ENATIVETYPE param1, ENATIVETYPE param2)
{
switch(msg)
{
    case WM_KEYUP:
         // only get WM_KEYUP
     break;
    case WM_KEYDOWN:
         // can't get WM_KEYDOWN
     switch(param1)
     {
        case VK_TEND:
            printf("got VK_TBACK\r");
        ret = true;
        break;
          }
}
}
18 lines; 9 keywds; 0 nums; 27 ops; 1 strs; 2 coms    Syntactic Coloring v0.4 - Dan East  


But I can't receive WM_KEYDOWN (only WM_KEYUP) through OnNativeEvent,
is there something I missed?

I also tried to always return true then I can get WM_KEYDOWN, is this behavior normal?


Thank,
mamahow
mamahow
pm Member
 
Posts: 17
Joined: Jul 1, 2008 @ 10:29am


Postby edge » Feb 23, 2009 @ 8:26am

Hi,

Yes, it's normal behaviour to return true when handling the WM_KEYDOWN and WM_KEYUP messages. From our own experiences some buttons may have alternative behaviour (for example only receiving WM_KEYDOWN). A good example is the red 'end dial' button on some Smartphones.
EDGELIB: Cross-platform mobile development at your fingertips
http://www.edgelib.com
User avatar
edge
pm Member
 
Posts: 1180
Joined: Aug 22, 2005 @ 3:42pm
Location: The Netherlands


Return to EDGELIB


Sort


Forum Description

Powerful and affordable C++ middleware solution covering true multi-platform 2D, 3D and network features for Apple iPhone, Windows Mobile, Symbian S60, UIQ, Linux and Windows desktop.

Moderator:

edge

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron