473,385 Members | 1,838 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Keyboard Listener

Hi all,

I'm just a newbie doing undergrad in Computing. I always face problems
when it comes to looking for an appropriate method. Lately, I've been
trying to write an application that listens to every single keystroke
from the keyboard. I don't seem to be able to find the proper way to
do that. Thanks in advance!!
Nov 20 '05 #1
3 6890
in the form props turn keypreview on
in the code use the keydown (sometimes key up or keypres could be better)
example
\\
Private Sub frm_KeyDown(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
Try
If e.KeyCode = Keys.Enter Or e.KeyCode = Keys.Return Then
'txt()
Select Case True
Case txtZoek.Focused
vulData()
Case Else
SendKeys.Send("{Tab}")
End Select
End If

If e.KeyCode = Keys.Down Then
GridDown()
End If

If e.KeyCode = Keys.Up Then
GridUp()
End If

Catch ex As Exception
fmMain.boodschap("formkeydown: " & ex.Message, 6)

End Try
End Sub
//

"YSChong" <yi****@hotmail.com> wrote in message
news:be**************************@posting.google.c om...
Hi all,

I'm just a newbie doing undergrad in Computing. I always face problems
when it comes to looking for an appropriate method. Lately, I've been
trying to write an application that listens to every single keystroke
from the keyboard. I don't seem to be able to find the proper way to
do that. Thanks in advance!!

Nov 20 '05 #2
Hi,

If you are looking to recieve all keys pressed (not just in your
application) you need to use a keyboard hook.
http://www.developer.com/net/net/art...1087_2193301_3

Ken
----------------
"YSChong" <yi****@hotmail.com> wrote in message
news:be**************************@posting.google.c om...
Hi all,

I'm just a newbie doing undergrad in Computing. I always face problems
when it comes to looking for an appropriate method. Lately, I've been
trying to write an application that listens to every single keystroke
from the keyboard. I don't seem to be able to find the proper way to
do that. Thanks in advance!!

Nov 20 '05 #3
* yi****@hotmail.com (YSChong) scripsit:
I'm just a newbie doing undergrad in Computing. I always face problems
when it comes to looking for an appropriate method. Lately, I've been
trying to write an application that listens to every single keystroke
from the keyboard. I don't seem to be able to find the proper way to
do that.


<URL:http://www.developer.com/net/net/article.php/11087_2193301_1/>

Win32 documentation on hooks:

<URL:http://msdn.microsoft.com/library/en-us/winui/WinUI/WindowsUserInterface/Windowing/Hooks/AboutHooks.asp>

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Steve High | last post by:
Is there a way to use a keyboard listener in applications other than applets? I am trying to make a simple text editor that stores words in a LinkedList, then checks each word in the list against...
1
by: Cherrish Vaidiyan | last post by:
sir, I have a small error in Listener configuration.I have two system with a database in each. I am using Red Hat 9 and Oracle 9i. so i shall anme the database and system. system 1 - node2 ...
5
by: Axel Dachtler | last post by:
Hi, I have a listener problem. The listener cannot read SERVICE_NAME in TNS-Descriptor. The service-name I specified in Oracle Net Manager for this database is testdb as well. ...
3
by: Bill | last post by:
When vb6 Winsock.RemoteHost is set to "127.0.0.1", c# socket listener cannot hear connect request (my old vb6 winsock listener could hear it...). Why doesn't this work, and is there a work...
2
by: Dan | last post by:
I have an application that uses a COM port barcode scanner. This uses a listener to notify the application when a barcode has been scanned. The application now needs to be modified to use a Human...
6
by: Steve Teeples | last post by:
I have been perplexed by how to best treat an event that spans different classes. For example, I have a form which a user inputs data. I want to broadcast that data via an event to another...
5
by: mivey4 | last post by:
Hi, First off, I am aware that this is a very heavily documented error and I have done my homework for throughly researching probable causes before deciding to post my problem here. At this point,...
9
by: Kbalz | last post by:
I have an application that minimizes itself, and I want it to listen for certain key commands, and when they are pressed, my program can react to them. So far I've gotten my application to react...
1
by: michael ngong | last post by:
michael.john@gmx.at (Michael John) wrote in message news:<90cc4edd.0306230900.28075193@posting.google.com>... MIchael I you stated the OS and platform that could make it easier to address your...
3
by: fts2012 | last post by:
Hi all, I want to realize a function which could remember the latest several items in clipboard. I hava alreay known the method get the pressed keys when my program is on active ,but I don't know...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.