none
I need to know how Keypad timer logic is working & which timer function is better for keypad logic for Platform builder 6.0(Mvisual studio) RRS feed

  • Question

  • Hi.,

    This is saravanan from bangalore.My Domain is WINCE(RTOS).,I am working Platform builder 6.0 in Microsoft visual studio 5.0 ..Here  I  am doing the keypad(6*5)logic (alphabetical & numerical)...Now i am developing a code for single key .,for eg:In our cell NO-2 key have a alphabet(abc) ...In my pgm i am printing the alphabet lilke if i press the no 2 key ONE time it will print a,if i press TWO times means it will printed a & b ,Here the my issue...i dont want print a & b if i press continously TWO times(b should be printed if i press TWO Times).......... I need to print b character if i press the key TWO times...I need to know how i develop the logic for this one ,Because Timer or sleep mode should be needed for this logic...Can u help me for this one..wheather i have to choose sleep mode are Timer...If i use the timer what kind of timer function i have to choose for keypad logic ...

    Friday, July 16, 2010 7:08 AM

Answers

  • hi.,

               How to dispaly the character on taskbar in wince 6....Using c++ i have to display the character on taskbar ..for eg.. if i press the key ctrl key - On taskbar i should print 'C' character only ... 2)if i press (ctrl+shift) keys - i should print 'A' key...I am not aware of this one ... Can anyone help me (how to do)....

     

     

     

    Regards

    Saravanan G

    Tuesday, July 27, 2010 12:43 PM

All replies

  •  

    Hi Sarvanan,

     

    Which processor are you working with ???

    You can use hardware timer for this as the time duration needs to be precise.

    Using software timer could be another solution but i am not sure about the real time feel that you are looking for.

     

    In the timer call back just check if the scan code for if the same key is pressed. If yes send the second key event else send the second key event.

     

    Run the timer when first key is pressed.

     

    Timer shall be programmed in one short mode.

     

    regard,

    Misbah

     

     

    Friday, July 16, 2010 7:42 AM
  • Hi,

    Not really sure what you're asking, are you ?
    I donot see any timing requirement in your description.
    Maybe timing comes in the picture when defining "continuously" ?

    At what level are you implementing this ? Application (as regular keyboard) , or are you writing a driver for the keyboard device ? From the description I would guess this behaviour can be implemented using regular KEYDOWN/KEY_UP messages. But probably I am missing something ?

    Kind regards,
    Rob
    www.robtso.nl

     

     

     

     

    Friday, July 16, 2010 8:56 AM
  • Hi Sarvanan ,

     

    I guess timing will come into picture when you would work with your GUI application.

    Software timers are not real time in nature. Using H/W timer is a good solution. You need to design as per your requirement.

    To send a key event it shall be KEYDOWN/KEY_UP message with virtual key.

     

    Kindly post your real requirement so that we shall understand it properly then only we could be able to conclude.

     

    regards,

    Misbah

    Friday, July 16, 2010 9:51 AM
  • Hello Sir.,

                        I am doing keypad logic for handheld devices...In that keypad there is 6*5 matrix keys are available...Default code is there for numerals(0-9) ...But My task is develop the logic for (a-z)(A-Z)..In our mobiles have a no & alphabets ..For eg..2 key no have abc,3keyno have cde like that it goes to 9(wxyz)....

     Now i am doing the logic for (a-z) &(A-Z)....In my logic If i press the button with delay it will print  orderly thats ok...but if i press continously the same button without delay means .. for eg.. 3key no in our cell have a alphabets(def)...if i press the key no 3 continously in two times without any one sec i need to print e character...thats delay are timing between two characters thats i want to know...kindly reply me.....

    Friday, July 16, 2010 12:05 PM
  • HI.,

                       I am using samsung processor(s3c6410) ...

     

     

     

    Regards

    Saravanan G

     

    Friday, July 16, 2010 12:13 PM
  • You can use WaitForSingleObject( hEvent, 1000 ) where you set the even when a key is pressed.  If no keys are pressed for 1 second the this times out and sends the last character to the app.
    Bruce Eitman (eMVP)
    Senior Engineer
    Bruce.Eitman AT Eurotech DOT com
    My BLOG http://geekswithblogs.net/bruceeitman

    Eurotech Inc.
    www.Eurotech.com
    Friday, July 16, 2010 2:02 PM
    Moderator
  • Hi.,

           This is saravanan,Is there any other API is there in WINCE 6.0 based on delay with timing value calculation ...

    For eg,Cell phone

          *If we press the key one time first character 'a' will print .,if i take delay  and press the same key means --it also print first character 'a'...

    * if we press the key 3 times means c,2 times means b.like that i want to print in my keypad ...

    Is there any other API like (calculating a timing value  & delay)based on only i can able to print the character in display....kindly reply me...

    Thursday, July 22, 2010 3:58 AM
  • You'd need a timer that runs faster than the system timer (1ms), if you need better resolution than 1ms.  If 1ms is good enough, GetTickCount() will return the number of ticks since Windows CE startup.  If you have a hardware timer/counter in your processor that you can read from your driver, you could arrange to devote that to counting.  If it ran at, say, 1MHz, you'd be able to read the difference between 1uS and the next.

    For keyboard stuff, I find it hard to believe that 1ms would not be good enough.

    Paul T.

    Thursday, July 22, 2010 11:13 PM
  • I just don't think that you need a timer or a delay.  You need to know:

    • What key was pressed last (LastKey)
    • What key is currently pressed (CurrentKey)
    • What the last character you displayed was
    • When the last key was pressed (LastTime)
    • When the current key was pressed (CurrentTime)

    then if( (LastKey == CurrentKey) && ((CurrentTime - LastTime) < 1000 )) update the current displayed character with the next one in the list for the current key.

    You can use GetTickCount() for that.


    Bruce Eitman (eMVP)
    Senior Engineer
    Bruce.Eitman AT Eurotech DOT com
    My BLOG http://geekswithblogs.net/bruceeitman

    Eurotech Inc.
    www.Eurotech.com
    Friday, July 23, 2010 9:24 PM
    Moderator
  • Hi Bruce Eitman.,

                              This is saravanan From India.... Thank You For your reply...

    I got  output using GetTickCount With your Good Guide.....

     

     

     

    Thank You once again

    Saravanan G

    Monday, July 26, 2010 1:13 PM
  • Hello Sir.,

                      This is saravanan ., How to lock/unlock  the keypad ...If i press the Func+F11 & show “K” on the task bar in screen...I am beginner of the WINCE 6...Now i am doing for that logic ...Every key have a scan code based on that i did before .. Now i have two keys(FUnc+F11) ....Is there any API Is there? for locking/unlocking... can u guide me....

     

     

    Regards

    Saravanan G 

    Tuesday, July 27, 2010 6:39 AM
  • That is usually done in hardware, so if your hardware doesn't do it, then you will need to do it in your software.


    Bruce Eitman (eMVP)
    Senior Engineer
    Bruce.Eitman AT Eurotech DOT com
    My BLOG http://geekswithblogs.net/bruceeitman

    Eurotech Inc.
    www.Eurotech.com
    Tuesday, July 27, 2010 12:39 PM
    Moderator
  • hi.,

               How to dispaly the character on taskbar in wince 6....Using c++ i have to display the character on taskbar ..for eg.. if i press the key ctrl key - On taskbar i should print 'C' character only ... 2)if i press (ctrl+shift) keys - i should print 'A' key...I am not aware of this one ... Can anyone help me (how to do)....

     

     

     

    Regards

    Saravanan G

    Tuesday, July 27, 2010 12:43 PM