VB.NET Class for monitoring the Keyboard on terminal servers

This project was awarded to hardcoderz for €205 EUR.

Get free quotes for a project like this
Project Budget
€30 - €250 EUR
Total Bids
Project Description

For a program to insert text blocks in other programs (eg MS Word) I need a [url removed, login to view] assembly to monitor the keyboard. The program will later be able to run on a terminal server in user sessions. I want both the DLL and the source code. Then name of the Monitor-Class will be "KeyWatch"

In the following I describe the monitoring class: KeyWatch



EventKey ->Type: Array of Integer

In EventKey I can have one or more deposit keycodes that cause the KeyWatch event.

SplitText ->Type: Array of Integer

In SplitText, I may deposit one or more separators.




Starts monitoring the keyboard


Stops monitoring the keyboard


Prevents further keystrokes.


Removed to prevent the keyboard

Send( text as String ) as Boolean

Send( iKeyCode as Integer [, Repeat as Integer ]) as Boolean

Sends the specified text or KeyCodes to the keyboard. Return True if Successfully.


Add the contents of the clipboard into the program (As if the user presses Strg-V)

So that I can insert graphics as well.



KeyWatch( KeyText as string )

If a key is pressed, which is stored in "EventKey" KeyWatch the event is triggered. The parameter (KeyText) is the text passed that was entered prior to the event are, to a separator that is stored in Split text.

##### If that does not work, I am grateful for every suggestion. #####


Public Class Form1

Dim WithEvents oKW As New KeyWatch

Dim aST(1) as Integer

Dim aEK(0) as integer

Private Sub Form1_Load(ByVal sender As Object, ByVal e As [url removed, login to view]) Handles [url removed, login to view]

'The delimiter are the carriage return and the space

aST(0) = vbLF

aST(1) = Asc( " ")

'The event will be triggered by the # sign.

aEK(0) = Asc( "#" )

oKW. SplitText = aST

oKW. EventKey = aEK

'Then monitoring starts

[url removed, login to view]

End Sub

Private Sub Form1_Disposed(ByVal sender As Object, ByVal e As [url removed, login to view]) Handles Me. Disposed

'If the window is closed, the monitoring of the keyboard are stop.

oWK. Stop

End Sub

Private Sub KeyWatch( KeyText as String ) Handles oKW. KeyWatch

'keyboard lock

[url removed, login to view]

If (KeyText = "car#" ) then

'Delete (KeyCode 8) the last 4 Chars, the Word "car#"

[url removed, login to view]( 8, 4 )

'Adds the specified text and makes a return.

[url removed, login to view]( "Jetzt soll hier dieser Text stehen!" & vbCrLf )

End If

'keyboard unlock

[url removed, login to view]

End Sub

End Class

If the user writes the following text: "The customer gets his car#"

with the touch of the #-sign triggered the event and the text (from right to left) to the first delimiter (space between "his" and "car") passed to the event -> "car#"

I apologize for my bad English, because I understand only the language with a translation program.

Awarded to:
Skills Required

Looking to make some money?

  • Set your budget and the timeframe
  • Outline your proposal
  • Get paid for your work

Hire Freelancers who also bid on this project

    • Forbes
    • The New York Times
    • Time
    • Wall Street Journal
    • Times Online