473,381 Members | 1,615 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,381 software developers and data experts.

Recognizing keystrokes?

Hello,

Is there any way I can tell which key was pressed in VB Code using the
OnKeyPress event? I'd like to know if the user is pressing the up, down,
left or right arrow.

Thanks!
Mar 10 '06 #1
5 1912
Hi

Your answer is in this post:
http://groups.google.co.za/group/com...40f36f9d16efba

Sorry about the line breaks. You can also search this group by typing
"Cursor Value" next to the Search This Group button

Mar 10 '06 #2
Thanks Hansen, The "Cursor Value" isn't occuring when I hit the up, down
left or right keys. If I hit the letter / number keys, the keypress is
registering, but nothing when I hit the keys I want. Any ideas?
"Hansen" <he******@hotmail.com> wrote in message
news:11*********************@z34g2000cwc.googlegro ups.com...
Hi

Your answer is in this post:
http://groups.google.co.za/group/com...40f36f9d16efba

Sorry about the line breaks. You can also search this group by typing
"Cursor Value" next to the Search This Group button

Mar 11 '06 #3
Rico wrote in message <DrCQf.26216$Ui.6883@edtnps84> :
Thanks Hansen, The "Cursor Value" isn't occuring when I hit the up, down
left or right keys. If I hit the letter / number keys, the keypress is
registering, but nothing when I hit the keys I want. Any ideas?
"Hansen" <he******@hotmail.com> wrote in message
news:11*********************@z34g2000cwc.googlegro ups.com...
Hi

Your answer is in this post:
http://groups.google.co.za/group/com...40f36f9d16efba

Sorry about the line breaks. You can also search this group by typing
"Cursor Value" next to the Search This Group button


Try using the KeyDown (not KeyPressed) event, and test the KeyCode

--
Roy-Vidar
Mar 11 '06 #4
Rico wrote:
Thanks Hansen, The "Cursor Value" isn't occuring when I hit the up, down
left or right keys. If I hit the letter / number keys, the keypress is
registering, but nothing when I hit the keys I want. Any ideas?
"Hansen" <he******@hotmail.com> wrote in message
news:11*********************@z34g2000cwc.googlegro ups.com...
Hi

Your answer is in this post:
http://groups.google.co.za/group/com...40f36f9d16efba

Sorry about the line breaks. You can also search this group by typing
"Cursor Value" next to the Search This Group button

As Roy-Vidar indicated you need to use the KeyDown event to trap arrow
and function keys. KeyPress only shows ASCII values.

In KeyDown, the value KeyCode will contain:

Up-Arrow: 38
Down-Arrow: 40
Left-Arrow: 37
Right-Arrow: 39

HTH
--
Randy Harris
tech at promail dot com
I'm pretty sure I know everything that I can remember.
Mar 11 '06 #5
Excellent! Thanks guys!

"Randy Harris" <pl****@send.no.spam> wrote in message
news:aY******************@newssvr21.news.prodigy.c om...
Rico wrote:
Thanks Hansen, The "Cursor Value" isn't occuring when I hit the up, down
left or right keys. If I hit the letter / number keys, the keypress is
registering, but nothing when I hit the keys I want. Any ideas?
"Hansen" <he******@hotmail.com> wrote in message
news:11*********************@z34g2000cwc.googlegro ups.com...
Hi

Your answer is in this post:
http://groups.google.co.za/group/com...40f36f9d16efba

Sorry about the line breaks. You can also search this group by typing
"Cursor Value" next to the Search This Group button

As Roy-Vidar indicated you need to use the KeyDown event to trap arrow and
function keys. KeyPress only shows ASCII values.

In KeyDown, the value KeyCode will contain:

Up-Arrow: 38
Down-Arrow: 40
Left-Arrow: 37
Right-Arrow: 39

HTH
--
Randy Harris
tech at promail dot com
I'm pretty sure I know everything that I can remember.

Mar 11 '06 #6

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

Similar topics

2
by: Olli Piepponen | last post by:
Hi, I'm having a little problem catching keystrokes under Windows. I did a little research and found that with mscvrt.getch() one can cath a single key that is pressed. However this doesn't work...
2
by: Steven Raasch | last post by:
I would really like to send keystrokes to a QT application from another program. The ideal situation would allow me to use STDIN, but I'm guessing that this is not going to happen. Keeping in...
3
by: Wayne | last post by:
I have a console application (ssh2.exe) that requires keystrokes to be sent to it after activating. I have worked that it needs to be started in it own thread, but capturing the process and...
5
by: Lucas Tam | last post by:
Hi all, Has anyone done this before? Send client side keystrokes to an application from a webpapge? This maybe more of a Javascript question. In short, I have an application on the client's...
2
by: zak | last post by:
I have some testing to do and I need to put a whole set of data in I want to Record and replay in a loop keystrokes. An idea
2
by: Tim Diggle | last post by:
I'm trying to enter data into a database application running under Citrix ICA Client. I'm doing it from a VBA macro running under Microsoft Excel 2000 (although it may need to be backwardly...
3
by: Gunnar Syren | last post by:
I'm trying to implement a macro feature in my application by recording and playing back keystrokes. At first I thought it would be enough to catch KeyDown in my main form, but I soon realized that...
1
by: zanthor | last post by:
Ok... so call me crazy, but I have an idea and I'm looking for where to start... I want to write an application that catches keystrokes and then either redirects them to the in focus window or...
1
by: thulaseeram | last post by:
hi, i am using the following code for uploading <div id="iframe" name="iframe" style="width:850px; height:120px;"> <iframe name="attach_frame" id="attach_frame"...
4
by: Vighneswar | last post by:
Hi All Can anybody please suggest me in this regard that I need to capture the keystrokes on all the word processors (Ms Word, Excel .. Etc), text editors (Notepad .. Etc) and suggest nearer...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...

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.