Results 1 to 5 of 5

Thread: Can you send a spacebar key in vb.net?

  1. #1

    Joined
    Dec 2011
    Posts
    151
    Userbars
    2
    Thanks
    4
    Thanked
    165/45
    DL/UL
    14/9
    Mentioned
    68 times
    Time Online
    6d 17h 26m
    Avg. Time Online
    2m

    Can you send a spacebar key in vb.net?

    I am trying to send the spacebar key to a flash object, this was very easy in VB6. I have tried SendKeys.Send(Keys.Space), SendKeys.Send(" ") and SendKeys.Send("{SPACE}"). I am not sure why they are not working, does anybody know how to send the spacebar key in vb.net.

    The code used in vb6 was SendScanKey VkKeyScan(Asc(" ")).

    I am trying to get the next round to start automatically in typing terror.


  2. #2
    Saiyan Race
    j03's Avatar
    Joined
    Dec 2011
    Posts
    13,720
    Userbars
    166
    Thanks
    5,906
    Thanked
    33,076/6,608
    DL/UL
    23/36
    Mentioned
    3,867 times
    Time Online
    563d 4h 55m
    Avg. Time Online
    3h 13m
    We also tried Sendkeys.send(keys.space)
    @(you need an account to see links)


    Sent from my iPhone using Tapatalk

    ---------- Post added at 01:35 PM ---------- Previous post was at 01:35 PM ----------

    Keep in mind it is sending space but when trying to send to a flash object it is not being picked up.


    Sent from my iPhone using Tapatalk
    (you need an account to see links)
    (you need an account to see links)(you need an account to see links)

    ------------------------
    [02/24/2013] Stealth CORE is made into the first standalone Neopets auto-player.
    ------------------------


  3. The Following User Says Thank You to j03 For This Useful Post:

    Zachafer (02-27-2016)

  4. #3
    Atlas's Avatar
    Joined
    Jun 2013
    Posts
    260
    Userbars
    6
    Thanks
    668
    Thanked
    430/149
    DL/UL
    67/8
    Mentioned
    123 times
    Time Online
    27d 4h 44m
    Avg. Time Online
    9m
    I also had this problem when I made a Faerie Caves II Bot with Python.
    For me, I just solved it by clicking the screen (clicking works for typing terror too).

  5. #4
    Zachafer's Avatar
    Joined
    Dec 2011
    Posts
    1,235
    Userbars
    11
    Thanks
    769
    Thanked
    1,466/678
    DL/UL
    98/0
    Mentioned
    512 times
    Time Online
    24d 13h 9m
    Avg. Time Online
    8m
    Quote Originally Posted by Soredavide View Post
    I am trying to send the spacebar key to a flash object, this was very easy in VB6. I have tried SendKeys.Send(Keys.Space), SendKeys.Send(" ") and SendKeys.Send("{SPACE}"). I am not sure why they are not working, does anybody know how to send the spacebar key in vb.net.

    The code used in vb6 was SendScanKey VkKeyScan(Asc(" ")).

    I am trying to get the next round to start automatically in typing terror.
    Hey @(you need an account to see links) nice to see you!
    The correct way to send a space with SendKeys is SendKeys(" ").
    First, I would try setting the Form's KeyPrevew to True (is false by default).
    Make sure you are calling Focus() on the flash object before sending keys.

    I've never done it in .NET, but you can send VK_SPACE (short=32). See the answer here: (you need an account to see links)

    If you can't get these to work, I can rewrite the SendScanKey for VBNet

  6. #5

    Joined
    Dec 2011
    Posts
    151
    Userbars
    2
    Thanks
    4
    Thanked
    165/45
    DL/UL
    14/9
    Mentioned
    68 times
    Time Online
    6d 17h 26m
    Avg. Time Online
    2m
    VK_SPACE does not seem to be allowed in flash
    Code:
        Private Declare Sub keybd_event Lib "User32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
        Public Const VK_SPACE = &H20
    
            Me.KeyPreview = True
            ShockwaveFlash1.Focus()
            keybd_event(VK_SPACE, 0, 0, 0)
    NVM; that worked, thanks.
    Last edited by Soredavide; 02-28-2016 at 01:03 PM.

Posting Permissions

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