PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Compact Framework Programatically Calling a Softkey (device button)

Reply

Programatically Calling a Softkey (device button)

 
Thread Tools Rate Thread
Old 28-12-2004, 03:56 PM   #1
Zac Maclean
Guest
 
Posts: n/a
Default Programatically Calling a Softkey (device button)


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


  Reply With Quote
Old 28-12-2004, 06:22 PM   #2
Paul G. Tobey [eMVP]
Guest
 
Posts: n/a
Default Re: Programatically Calling a Softkey (device button)

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.

"Zac Maclean" <askme@some.com> wrote in message
news:%23lvQi1O7EHA.2180@TK2MSFTNGP12.phx.gbl...
> 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
>



  Reply With Quote
Old 28-12-2004, 08:57 PM   #3
Zac Maclean
Guest
 
Posts: n/a
Default Re: Programatically Calling a Softkey (device button)

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 news:O4xnTHQ7EHA.3596@TK2MSFTNGP12.phx.gbl...
> 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.
>
> "Zac Maclean" <askme@some.com> wrote in message
> news:%23lvQi1O7EHA.2180@TK2MSFTNGP12.phx.gbl...
>> 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
>>

>
>



  Reply With Quote
Old 28-12-2004, 09:40 PM   #4
Paul G. Tobey [eMVP]
Guest
 
Posts: n/a
Default Re: Programatically Calling a Softkey (device button)

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

Paul T.

"Zac Maclean" <askme@some.com> wrote in message
news:eXg04dR7EHA.3076@TK2MSFTNGP15.phx.gbl...
> 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 news:O4xnTHQ7EHA.3596@TK2MSFTNGP12.phx.gbl...
>> 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.
>>
>> "Zac Maclean" <askme@some.com> wrote in message
>> news:%23lvQi1O7EHA.2180@TK2MSFTNGP12.phx.gbl...
>>> 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
>>>

>>
>>

>
>



  Reply With Quote
Old 29-12-2004, 02:58 PM   #5
Zac Maclean
Guest
 
Posts: n/a
Default Re: Programatically Calling a Softkey (device button)

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/top...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 [eMVP]" <ptobey no spam AT no instrument no spam DOT com>
wrote in message news:%236q5w1R7EHA.2540@TK2MSFTNGP09.phx.gbl...
> "#5"? F5? ASCII 202? The virtual key code 202? Show me how you'd
> capture it in code...
>
> Paul T.
>
> "Zac Maclean" <askme@some.com> wrote in message
> news:eXg04dR7EHA.3076@TK2MSFTNGP15.phx.gbl...
>> 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 news:O4xnTHQ7EHA.3596@TK2MSFTNGP12.phx.gbl...
>>> 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.
>>>
>>> "Zac Maclean" <askme@some.com> wrote in message
>>> news:%23lvQi1O7EHA.2180@TK2MSFTNGP12.phx.gbl...
>>>> 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
>>>>
>>>
>>>

>>
>>

>
>



  Reply With Quote
Old 29-12-2004, 05:21 PM   #6
Paul G. Tobey [eMVP]
Guest
 
Posts: n/a
Default Re: Programatically Calling a Softkey (device button)

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" <askme@some.com> wrote in message
news:udYP45a7EHA.208@TK2MSFTNGP12.phx.gbl...
> 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/top...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 [eMVP]" <ptobey no spam AT no instrument no spam DOT com>
> wrote in message news:%236q5w1R7EHA.2540@TK2MSFTNGP09.phx.gbl...
>> "#5"? F5? ASCII 202? The virtual key code 202? Show me how you'd
>> capture it in code...
>>
>> Paul T.
>>
>> "Zac Maclean" <askme@some.com> wrote in message
>> news:eXg04dR7EHA.3076@TK2MSFTNGP15.phx.gbl...
>>> 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 news:O4xnTHQ7EHA.3596@TK2MSFTNGP12.phx.gbl...
>>>> 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.
>>>>
>>>> "Zac Maclean" <askme@some.com> wrote in message
>>>> news:%23lvQi1O7EHA.2180@TK2MSFTNGP12.phx.gbl...
>>>>> 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
>>>>>
>>>>
>>>>
>>>
>>>

>>
>>

>
>



  Reply With Quote
Old 29-12-2004, 06:16 PM   #7
Zac Maclean
Guest
 
Posts: n/a
Default Re: Programatically Calling a Softkey (device button)

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 [eMVP]" <ptobey no spam AT no instrument no spam DOT com>
wrote in message news:%23K6X8Jc7EHA.1292@TK2MSFTNGP10.phx.gbl...
> 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" <askme@some.com> wrote in message
> news:udYP45a7EHA.208@TK2MSFTNGP12.phx.gbl...
>> 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/top...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 [eMVP]" <ptobey no spam AT no instrument no spam DOT com>
>> wrote in message news:%236q5w1R7EHA.2540@TK2MSFTNGP09.phx.gbl...
>>> "#5"? F5? ASCII 202? The virtual key code 202? Show me how you'd
>>> capture it in code...
>>>
>>> Paul T.
>>>
>>> "Zac Maclean" <askme@some.com> wrote in message
>>> news:eXg04dR7EHA.3076@TK2MSFTNGP15.phx.gbl...
>>>> 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 news:O4xnTHQ7EHA.3596@TK2MSFTNGP12.phx.gbl...
>>>>> 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.
>>>>>
>>>>> "Zac Maclean" <askme@some.com> wrote in message
>>>>> news:%23lvQi1O7EHA.2180@TK2MSFTNGP12.phx.gbl...
>>>>>> 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
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>

>>
>>

>
>



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off