?
Solved

Low Level Keyboard read

Posted on 2003-03-22
15
Medium Priority
?
164 Views
Last Modified: 2010-05-01
Least i think i want a low level keybd read, unless im missing something!

i have a set of routines that react to simple keystrokes (a-z/0-9) but
the routines are not linked to anything that has focus - so i cant
use a text box or form key handler. ok so i need to poll the keys pressed...
ive looked & looked and all examples seem to show how to sendkeys and do
interesting things but nothing seems to cover this basic want.

how do i continually get the key presses from the keybd so i can process and
do stuff with?

rgds
Shilling

0
Comment
Question by:Shilling
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 6
15 Comments
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 8186622
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 8186623
0
 

Author Comment

by:Shilling
ID: 8186881
Richie,
thx for quick repsonse.
id 1610 as the virgin said to the bishop - looks gr8 but i havent got a clue what to do with it.
can u tell me how to get a handle on it.
every time i type a qwerty key i would like it to echo that key...

so if i add a form with a label1
i would like that label to echo the qwerty key press.

c = TheKeyPressed
so c = ????????????????????
label1.caption = c


thx again -
id 728 crashed me out but thats another story more to do with the thin ice im developing on than anything else.
rgds
Shilling
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 16

Accepted Solution

by:
Richie_Simonetti earned 300 total points
ID: 8187204
1610: You have to save/register dll at windows/system directory.
From there you can add ato your project (project->references) and work with from there.
What is the specific problem?
0
 

Author Comment

by:Shilling
ID: 8187311
Richie,

r u asking re initial question.

i am writing a program that sits sits alongside a proprietary client. It is meant to keep track of what that client is doing. This is achieved by clicking on images on myForm or typing in two letter representations of those  images, etc eg 's' & '7'.

The proprietary client takes focus as is only right. To get the 's7' in at the moment you have to click on myForm to get it to register the 'a' and then the 's'.

So i need something to override this. ie run a program that polls keybd and passes values to my prog, whomever has focus.

or my prob with 16:10
i would thought it would be a basic ms requirement to offer a facility to poll the keybd. I am finding the code in 1610 verbose and am confused as to what to actually call to get the keybd vals. A line of code, that gave me the handle i want, would open the door for me and i could go from there.

is that pos?

thx again.

rgds
Shilling






0
 

Author Comment

by:Shilling
ID: 8187484
Richie,
im running from an environment where i cant reboot the machine - it clears my space entirely - and i cant register anything with windows - (thin ice) - this is why 16:10 wont run - no prob if it works i can pull it in later on the dev cycle when cirumstance have changed.

I just dont understand why this isnt standard vb fare - but thats not ur pob.
thx very much for help.

rgds
denis
0
 

Author Comment

by:Shilling
ID: 8187488
amazingly swift response time.
rgds
Shilling.
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 8187598
Well, it worked!

A simple way (i don't know if it meets what you need)
Set Form's keypreview property to true, add a label (label1) with caption=""

in Keypress event of form, paste this:
Private Sub Form_KeyPress(KeyAscii As Integer)
label1.caption=label1.caption &  chr$(keyascii)
End Sub

It will not work with backspace. To do so we have to do in other way.
0
 

Author Comment

by:Shilling
ID: 8187650
Richie,
but the form will always have to have focus or it doesnt work and as i am using this form to add value to a proprietary client which the user is constantly clicking and entering things into this cant be the case can it?
to work the user has to
click and enter in otherForm
then ...
click myForm
before they type in the keys to be caught
which is not practible. unless u know diferent!
0
 

Author Comment

by:Shilling
ID: 8187699
Richie,
but the form will always have to have focus or it doesnt work and as i am using this form to add value to a proprietary client which the user is constantly clicking and entering things into this cant be the case can it?
to work the user has to
click and enter in otherForm
then ...
click myForm
before they type in the keys to be caught
which is not practible. unless u know diferent!
0
 

Author Comment

by:Shilling
ID: 8189276
Richie,
but the form will always have to have focus or it doesnt work and as i am using this form to add value to a proprietary client which the user is constantly clicking and entering things into this cant be the case can it?
to work the user has to
click and enter in otherForm
then ...
click myForm
before they type in the keys to be caught
which is not practible. unless u know diferent!
0
 

Author Comment

by:Shilling
ID: 8189277
Richie,
but the form will always have to have focus or it doesnt work and as i am using this form to add value to a proprietary client which the user is constantly clicking and entering things into this cant be the case can it?
to work the user has to
click and enter in otherForm
then ...
click myForm
before they type in the keys to be caught
which is not practible. unless u know diferent!
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 8191778
As i said, i didn't know the complete scenario so my first post is what you need.
0
 

Author Comment

by:Shilling
ID: 8195670
Richie,
thx for all the help but i have stated in the original post: "the routines are not linked to anything that has focus - so i cant use a text box or form key handler."

ive since found an answer from one of your other experts
Q_20049306.html
which talks of directx - any comments?

0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 8196066
On that link, there are comments from Ark, which is the author of the code at first link posted by me.
i don't know about Directx.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question