CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    May 2008
    Posts
    74

    see what key was pressed

    hi,
    i have a pocket pc that have some special keys
    and i need detect when a key is pressed in my program.
    how can i detect the keys that is pressed?
    i have tested in a textbox change function
    the box detect all keys except that special keys
    there is some api to look for alk keys that´s is pressed
    in pocket pc?
    thanks a lot for your help

  2. #2
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: see what key was pressed

    One of the easiest ways is to set the forms keypreview property to true
    Then in form keypress you can see which key is pressed.

    You can also do this in a controls keypress event.

    This works for the more common keys. in some cases you may need to use the keydown event instead.

  3. #3
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: see what key was pressed

    Do not use the changed event for this as this event can fire when no key has been pressed and can lead to errors in your program.

  4. #4
    Join Date
    May 2008
    Posts
    74

    Re: see what key was pressed

    hi,
    thanks for your help

    i have done that of the forms key pressed and that works perfect for what i need!
    thanks a lot for your help

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured