Re: Keypad driver long keypress

Tomal Paul <[email protected]> Tue, 1 Feb 2005 12:09:00 +0530
Newsgroups gmane.comp.windows.ce.freeware
Message-ID <[email protected]>
HI Dhanesh,

Thanks for the reply. Your solution is applicable to application
development for not driver development.

Kindly suggest a solution for driver devlopment.

Regards,
Tomal


On Tue, 01 Feb 2005 09:43:52 +0530, Dhanesh D Pai
<[email protected]> wrote:
> Tomal wrote:
> 
> > I'm struck implementing the long keypresses. Kindly suggest me a way
> > to implement the same.
> >
> One solution will be make a note of time for which the key is pressed. 
> It can be somthing like this
> 
> Once you get the WM_KEYDOWM msg make a note of the GetTickCount return 
> value.
> Next for the same key when you get the WM_KEYUP msg substract the 
> current GetTickCount with the previously stored value.
> 
> i.e  duration = currect_tick - last_tick
>        Now that when you say __shortkeypress__ and __longkeypress__ it 
> is implied that it has something to do with the time duration for which 
> it is pressed.
>      Now you have to decide what  duration is short for you and what is 
> long ...One example case may be
> 
> if ( duration > 300) /* in msec*/
> {
>     /* its a longer press*/
> }
> else
> {
>   /*its a shorter press */
> }
> 
> There may be better ways to do ..this is one...if you find a better way 
> do post me also.
> 
> regards
> -d
> 
> 
> 
> ________________________________
> Yahoo! Groups Links
> To visit your group on the web, go to:
> http://groups.yahoo.com/group/wince-devel/
>   
> To unsubscribe from this group, send an email to:
> [email protected]
>   
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 


-- 
Regards,
Tomal Paul