Looking for code examples to Hook into Keyboard
Hi All,
1st post here and new to java other than an intro course at the local college (got a A-)
I'm looking to implement a small windows or console app that would be launched from a windows start up folder that would effectively monitor keystokes and when a certain string is entered, a popup dialog message box would appear as a reminder to do something. In this case a bar code scanner is in use, that emulates keyboard entry, so when a particular code is scanned, a dialog appears.
The machines are pretty much dedicated as bar code scanners, but if a user where to say open email and type in the proper sequence, I'd be ok with false positives. This program will monitor all keybpoard activity and wouldn't be limited to a particular application window that has focus.
Does any one have knowledge of where I might find src code or a demo application that I could modify that provides some of this functionality.
Btw: Win XP x86, Eclipse IDE.
thanks
Re: Looking for code examples to Hook into Keyboard
Quote:
I'm looking to implement a small windows or console app that would be launched from a windows start up folder that would effectively monitor keystokes and when a certain string is entered...
This would be - in effect, even if not in intent - spyware. As far as I know you can't do this in Java.
Re: Looking for code examples to Hook into Keyboard
Maybe I need to speak with a hacker they try to collect account numbers, ssn, and other important information.
But in my case I just need collect a string "abcdefghijklmnop" ect and if the sequence contains fghijkl then display a dialog.
I suspect I'll need a buffer of some length a firsin first out buffer and for each keypress scan the buffer to see if it contains a match
I'd like to code this in java, but I found code examples in C @ Global System Hooks in .NET - CodeProject®
I'm pretty sure this can be done in java, since it's assumed to be just as powerful as C++ down to the OS level. But I can't prove the assumption.