Results 1 to 7 of 7

Thread: Ignore the shiftkey

  1. #1
    egiggey
    Guest

    Ignore the shiftkey

    how can I have my app ignore the shift key

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    In what sense? Like with capital letters?
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  3. #3
    Fanatic Member Kaverin's Avatar
    Join Date
    Oct 2000
    Posts
    930
    What exactly are you trying to do by ignoring shift? The easiest way would be to just not make anything in your app that uses shift. Or if you had something look at keys you could do something like making Form.KeyPreview = True and then inside the Form_KeyDown (or KeyUp) event, flip the shift bit of the Shift parameter to 0.
    VB Code:
    1. Shift = Shift And (vbCtrlMask Or vbAltMask) 'turns of the shift bit
    I'm baaaack...
    VB5 Professional Edition, VC++ 6
    Using a 1 gHz Thunderbird, 256 mb RAM, 40 gb HD system with Win98se

    I feel special because I finally figured out how to loop midis: Post link
    I'm a fanatic too

  4. #4
    egiggey
    Guest
    I cant seem to figure it out and get it working.
    what i need is for the use to be able to hold the shift key during the function below and not affect it so I would like to ignore the shift key during the function

    Timer1.Enabled = False
    Dim strhwindow As String
    Dim StrFilename As String
    Dim s As String

    StrFilename = GetGUID & txtSuffix.Text & ".htm"

    strhwindow = FindWindow(vbNullString, "Save As...")
    If strhwindow <> 0 Then SendKeys StrFilename, wait
    If strhwindow <> 0 Then SendKeys "{Enter}", True
    Timer1.Enabled = True

    any ideas?

  5. #5
    egiggey
    Guest
    Anyone?

  6. #6
    Fanatic Member Kaverin's Avatar
    Join Date
    Oct 2000
    Posts
    930
    Is holding shift affecting the code you posted? I tried it out myself, and holding shift had no effect. The keys you specify for SendKeys are literal, so "a" is sent as "a", regardless of the shift state. Are you sure that you also have the window specified by strhwindow active? If it's not, SendKeys may not work as you expect. You can force it to be active by using the SetActiveWindow() API once you have the handle.
    I'm baaaack...
    VB5 Professional Edition, VC++ 6
    Using a 1 gHz Thunderbird, 256 mb RAM, 40 gb HD system with Win98se

    I feel special because I finally figured out how to loop midis: Post link
    I'm a fanatic too

  7. #7
    egiggey
    Guest
    what it is doing is insted of putting a nine in the filename from the getguid it puts in a ( all of the numbers do this and they are filenames and unix dosn't like that

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