Programatically Calling a Softkey (device button)

  • Thread starter Thread starter Zac Maclean
  • Start date Start date
Z

Zac Maclean

First: I have googled this. Lots of info everywhere about using device
buttons in programs, but I have yet to find anything on calling a buttton
press from a program.

I have a program that uses SQLCE and merge replication. I would like to
make the update process a few steps shorter by activating / deactivating the
WLAN as part of the program.

Just need to be pointed in the right place.


Devices are Dell Axim X3 and X30. Identical button configuration. Program
tested and running ono both.

Z. Maclean
 
Well, if you know what key the button represents, you can probably send it
via a P/Invoke of keybd_event(). *Do* you know what key it represents?

Paul T.
 
Well.. All the capture docs I found tell me it is #5. And for Dell Axims
it corresonpds to 202 rather than a default of 197 (more to it than just
that, but those identify it best) So.. If I know how to "capture" it, the
same info is used to call it ?
 
"#5"? F5? ASCII 202? The virtual key code 202? Show me how you'd capture
it in code...

Paul T.
 
So, you're saying that Hardware5 is the right value to capture this button?
If so, to send that key code, which is a virtual key code, you'd do the
following with keybd_event():

keybd_event( VK_whatever, VK_whatever, 0, 0 );
keybd_event( VK_whatever, VK_whatever, KEYEVENTF_KEYUP, 0 );

KEYEVENTF_KEYUP is defined as 0x0002.

Paul T.

Zac Maclean said:
The capture stuff I'd use is posted at OpenNETCF.org.
Looks like virtual key code. Also coded in HEX.

http://www.opennetcf.org/forums/topic.asp?TOPIC_ID=283&whichpage=1

I haven't played with it yet.. Was hoping not to have to add a whole new
module.

Will tackle it over the weekend. Have a lot to get done by Thursday...

Sole coder with a big project.. Lots of things running.


Paul G. Tobey said:
"#5"? F5? ASCII 202? The virtual key code 202? Show me how you'd
capture it in code...

Paul T.

Zac Maclean said:
Well.. All the capture docs I found tell me it is #5. And for Dell
Axims it corresonpds to 202 rather than a default of 197 (more to it
than just that, but those identify it best) So.. If I know how to
"capture" it, the same info is used to call it ?


"Paul G. Tobey [eMVP]" <ptobey no spam AT no instrument no spam DOT com>
wrote in message Well, if you know what key the button represents, you can probably send
it via a P/Invoke of keybd_event(). *Do* you know what key it
represents?

Paul T.

First: I have googled this. Lots of info everywhere about using
device buttons in programs, but I have yet to find anything on calling
a buttton press from a program.

I have a program that uses SQLCE and merge replication. I would like
to make the update process a few steps shorter by activating /
deactivating the WLAN as part of the program.

Just need to be pointed in the right place.


Devices are Dell Axim X3 and X30. Identical button configuration.
Program tested and running ono both.

Z. Maclean
 
Ok.. basically, I am turning on WLAN connection. I have logic figured out
to verify if I am connected or not. Calling keybd_event sounds right. I'll
dig into it.. :-)

Thanks for the input.


Paul G. Tobey said:
So, you're saying that Hardware5 is the right value to capture this
button? If so, to send that key code, which is a virtual key code, you'd
do the following with keybd_event():

keybd_event( VK_whatever, VK_whatever, 0, 0 );
keybd_event( VK_whatever, VK_whatever, KEYEVENTF_KEYUP, 0 );

KEYEVENTF_KEYUP is defined as 0x0002.

Paul T.

Zac Maclean said:
The capture stuff I'd use is posted at OpenNETCF.org.
Looks like virtual key code. Also coded in HEX.

http://www.opennetcf.org/forums/topic.asp?TOPIC_ID=283&whichpage=1

I haven't played with it yet.. Was hoping not to have to add a whole new
module.

Will tackle it over the weekend. Have a lot to get done by Thursday...

Sole coder with a big project.. Lots of things running.


Paul G. Tobey said:
"#5"? F5? ASCII 202? The virtual key code 202? Show me how you'd
capture it in code...

Paul T.

Well.. All the capture docs I found tell me it is #5. And for Dell
Axims it corresonpds to 202 rather than a default of 197 (more to it
than just that, but those identify it best) So.. If I know how to
"capture" it, the same info is used to call it ?


"Paul G. Tobey [eMVP]" <ptobey no spam AT no instrument no spam DOT
com> wrote in message Well, if you know what key the button represents, you can probably
send it via a P/Invoke of keybd_event(). *Do* you know what key it
represents?

Paul T.

First: I have googled this. Lots of info everywhere about using
device buttons in programs, but I have yet to find anything on
calling a buttton press from a program.

I have a program that uses SQLCE and merge replication. I would like
to make the update process a few steps shorter by activating /
deactivating the WLAN as part of the program.

Just need to be pointed in the right place.


Devices are Dell Axim X3 and X30. Identical button configuration.
Program tested and running ono both.

Z. Maclean
 
Back
Top