Quantcast
Channel: Remote Desktop Services (Terminal Services) forum
Viewing all articles
Browse latest Browse all 1106

RemoteApp receives multiple KeyUp events without any keys being pressed

$
0
0

Hi All,

I have a very simple winforms app that I am using to try and track down what is happening with keyboard events when using RemoteApp.

Basically I have a form and a textbox that track the KeyDown, KeyPress and KeyUp events.

As soon as I start my app via RemoteApp I receive multiple KeyUp events without even pressing a key.

Does anyone know why RemoteApp would be sending these random KeyUp events.

The code of my simple test app is as follows:

Public Class Form1

  Dim lst As New List(Of String)

  Private Sub AddtoList(str As String)
    lst.Add(str)
  End Sub

  Private Sub TextBox1_KeyDown(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown
    AddtoList("txt KeyDown" & vbTab & "KeyCode is " & e.KeyCode)
  End Sub

  Private Sub TextBox1_KeyPress(sender As Object, e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
    AddtoList("txt KeyPress" & vbTab & "KeyChar is " & e.KeyChar)
  End Sub

  Private Sub TextBox1_KeyUp(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyUp
    AddtoList("txt KeyUp" & vbTab & "KeyCode is " & e.KeyCode)
  End Sub

  Private Sub Form1_FormClosing(sender As Object, e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
    AddtoList("Form Closing")
    IO.File.AppendAllLines(Application.StartupPath & "\SimpleKeyUp_v2.txt", lst)
  End Sub

  Private Sub Form1_KeyDown(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
    AddtoList("Form KeyDown" & vbTab & "KeyCode is " & e.KeyCode)
  End Sub

  Private Sub Form1_KeyPress(sender As Object, e As System.Windows.Forms.KeyPressEventArgs) Handles Me.KeyPress
    AddtoList("Form KeyPress" & vbTab & "KeyChar is " & e.KeyChar)
  End Sub

  Private Sub Form1_KeyUp(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyUp
    AddtoList("Form KeyUp" & vbTab & "KeyCode is " & e.KeyCode)
  End Sub

  Private Sub Form1_Load(sender As Object, e As System.EventArgs) Handles Me.Load
    AddtoList("Form Load")
  End Sub
End Class

Simply opening and closing the app via RemoteApp gives the following results:

Form Load
Form KeyUp KeyCode is 9
txt KeyUp KeyCode is 9
Form KeyUp KeyCode is 16
txt KeyUp KeyCode is 16
Form KeyUp KeyCode is 16
txt KeyUp KeyCode is 16
Form KeyUp KeyCode is 17
txt KeyUp KeyCode is 17
Form KeyUp KeyCode is 17
txt KeyUp KeyCode is 17
Form KeyUp KeyCode is 9
txt KeyUp KeyCode is 9
Form KeyUp KeyCode is 18
txt KeyUp KeyCode is 18
Form KeyUp KeyCode is 9
txt KeyUp KeyCode is 9
Form KeyUp KeyCode is 18
txt KeyUp KeyCode is 18
Form KeyUp KeyCode is 9
txt KeyUp KeyCode is 9
Form Closing

Cheers and Thanks in Advance!

Dwayne


Viewing all articles
Browse latest Browse all 1106

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>