title: In VB 2013, is there a way to differentiate between a keyboard entry and a scanner entry?
body: <p>In Visual Basic 2013, is there a way to differentiate between a keyboard entry and a scanner entry?</p>
  
  <p>We have a program that the user will scan numbers into our system. On rare occasion, when the scanner does not work properly, the user will have to manually type the number in. As far as I can tell, VB sees the scanner entry the same way it sees the keyboard entry. Is there some piece of code that can check for a difference? Here is what I have started:</p>
  
  <pre><code>Private Sub CARD_KeyPress(sender As Object, e As System.Windows.Forms.KeyPressEventArgs)   Handles CARD.KeyPress
          If e.KeyChar = Convert.ToChar(Keys.Enter) Then
              If Me.CARD.Text &lt;&gt; "" Then
                 CardValidation()
              End If
          ElseIf e.KeyChar &lt;&gt; "" Then ' if entry a KEYPRESS then 
              DisplayErrorCodes()
          End If
      End Sub
  </code></pre>