|
||
|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
basically i'm making a program that listens for user input when it isn't the main focus and then outputs keyboard presses appropriately.
IE i'm typing in notepad and push f5 lets say, the program realizes this and then mimics keyboard presses using Robot...
|
|
||||
|
This is not possible in Pure Java due to the fact it runs on a VM. What you are after is a keyboard hook. Which must be written externally (making it platform dependant) and linked in using the likes of JNI. As it happens I am in the middle of doing this, and it's not straight forward I have to say, but that might just be my lack of experience and I am after all just a novice programmer. But I'd take a look at this thread.
http://www.javaprogrammingforums.com...oard-hook.html Regards, Chris |
|
||||
|
Are you writing your own notepad-like program? If so, check here.
If not, go with what the other people are saying. |
|
|||
|
i'm actually trying to make program that listens for keyboard input while it is in the background
for instance i'm playing a game and i press f5, i want the program to realize this (while its in the background) and push certain key combinations for me |
|
||||
|
Quote:
![]() Shame it's not so easy in Java!
__________________
Don't forget to add syntax highlighted code tags around your code: [highlight=Java] code here [/highlight] Forum Tip: Add to peoples reputation ( ) by clicking the button on their useful posts.
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Exception in thread "main" java.util.IllegalFormatWidthException: 13 | xtrive | Exceptions | 2 | 23-03-2010 05:38 AM |
| [SOLVED] Exception in thread "main" java.lang.NullPointerException | oscardog | Exceptions | 14 | 11-01-2010 09:36 AM |
| How to Create a server socket to listen for incoming connections | JavaPF | Java Code Snippets and Tutorials | 0 | 05-05-2009 01:02 PM |
| Looking for a programmer to make a simple program. | GrosslyMisinformed | Paid Java Projects | 3 | 27-01-2009 07:33 PM |
| I need someone to help me make algorithms | araujo3rd | Algorithms & Recursion | 1 | 10-12-2008 05:34 PM |
|
100 most searched terms
Search Cloud
|
| 2 dimensional arraylist java 2d arraylist java actionlistener actionlistener in java addactionlistener addactionlistener java convert double to integer java double format java double to integer in java double to integer java drag en drop programmeren java eclipse shortcut keys exception in thread "awt-eventqueue-0" java.lang.outofmemoryerror: java heap space exception in thread "main" java.lang.nullpointerexception exception in thread "main" java.lang.outofmemoryerror: java heap space format double in java format double java get mouse position java java 2d arraylist java actionlistener java double format java double formatting java double to int java double to integer java format double java forum java forums java get mouse position java list to map java mouse position java programming forum java programming forums java programming practice problems java send keystrokes to another application java two dimensional arraylist java.io.ioexception: premature eof java.lang.classformaterror: truncated class file java.lang.outofmemoryerror: java heap space java.util.arraylist jbutton action jbutton actionlistener jtextarea font jtextfield font size jxl.read.biff.biffexception: unable to recognize ole stream programming mutators and generics smack api two dimensional arraylist two dimensional arraylist java unable to sendviapost to url what is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20? |