Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6192935
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:01:55+00:00 2026-05-24T03:01:55+00:00

I have a form with 2 labels on it, the first label displays the

  • 0

I have a form with 2 labels on it, the first label displays the USB game pads name (once found) the second i want to display the button pushed, here’s what i have so far:

 Imports Microsoft.DirectX.DirectInput

Public Class Form1
Public _device As Device
Public _state As JoystickState
Public arm As Boolean = True


Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load

End Sub

Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
    Dim gameControllerList As DeviceList
    gameControllerList = Manager.GetDevices(DeviceClass.GameControl, EnumDevicesFlags.AttachedOnly)

    If (gameControllerList.Count > 0) Then

        Dim deviceInstance As DeviceInstance
        label.Text = "Found"
        For Each deviceInstance In gameControllerList
            _device = New Device(deviceInstance.InstanceGuid)
            label.Text = deviceInstance.InstanceName
            _device.SetDataFormat(DeviceDataFormat.Joystick)
            Exit For
        Next
    Else
        label.Text = "not found"
    End If
    output.Clear()
    _device.Acquire()

    Call Poll()
End Sub


Public Sub Poll()
    Dim buttons() As Byte
    Dim i As Integer = 0
    _device.Poll()
    _state = _device.CurrentJoystickState
    buttons = _state.GetButtons()
    Dim word As String
    word = BitConverter.ToString(buttons)
    output.AppendText(word)

End Sub

End Class

All i see are 0’s on the output, which means the buttons being pushed on the keypad arent being detected

Anyone know how i can resolve this issue?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T03:01:56+00:00Added an answer on May 24, 2026 at 3:01 am

    Funny enough, it’s exactly like the error says: you need to acquire the device before beginning to poll it.

    _device.Acquire();
    

    Note that this only happens once before the actual polling function.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form element defined as: <div class=field> <div class=name> <label for=User_LastName> Last
I have set the form decorators in this way: <?php $this->setElementDecorators(array( 'Label', array(array('labelTd' =>
Let's say I have an html form. Each input/select/textarea will have a corresponding <label>
i have a label in my form, and im trying to get the value
I have a label that is using a repeater to get information form a
I have a really simple search form with the following Label (Search) Textbox (fixed
When I have many controls on a Form (i.e. Label, Button etc) that do
I have an upload box... <form action=upload_file.php method=post enctype=multipart/form-data><BR> <label for=file>Filename:</label><BR> <input type=file name=file
I have form that displays several keywords (standard set of choice lists that changes
I have a Windows Forms Link Label, Refresh, that refreshes the display. In another

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.