CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 1999
    Posts
    102

    cleaning keyboard buffer - how?

    Hi,
    I am using a select case statment in a key press event to know when a the "." is pressed.
    When the "." is pressed - the app will do several rutines.
    All works fine - only - it turns out that the actual ploting of the "." on the screen will accur only when exiting from the keypress event - and that brings a problem -
    At that stage (when exiting from the keypress event) i dont need the ploting of the "." (it is plotted by one of the rutines in the select case options - and not as the last action eather - so i cant just leave it to be done by exiting the keypress event) - furthermore, this ploting of the "." will change the selstart and will triger the textchange event (i understand why - but dont wont it) whitch is not good for me.
    So my question is - is there a why to clean the the keyboard buffer just before getting out the the keypress event - or - i will apreciate any other good pointer to how to solve this specific problem.

    Thanks
    Dani



  2. #2
    Join Date
    May 1999
    Location
    Omika, Japan
    Posts
    729

    Re: cleaning keyboard buffer - how?

    You can set the KeyAscii value passed to the _kepPress event to zero to clear it and also you need to do the same in KeyUp Event too

    private sub text1_keyPress(keyascii as integer)
    .... do things
    keyAscii = 0
    end sub
    private sub Text1_KeyUp(Kecode as integer ...)
    if keycode = Asc(".") then keyCode = 0
    end sub




    RK

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