Return-Path: <jmorzins@MIT.EDU>
Received: from central-city-carrier-station.mit.edu by po11.mit.edu (8.9.2/4.7) id QAA04890; Wed, 9 Jan 2002 16:55:10 -0500 (EST)
Received: from melbourne-city-street.mit.edu (MELBOURNE-CITY-STREET.MIT.EDU [18.7.21.86])
	by central-city-carrier-station.mit.edu (8.9.2/8.9.2) with ESMTP id QAA02414;
	Wed, 9 Jan 2002 16:52:49 -0500 (EST)
Received: from mit.edu (RUBIDIUM.MIT.EDU [18.62.4.128])
	by melbourne-city-street.mit.edu (8.9.2/8.9.2) with ESMTP id QAA26877;
	Wed, 9 Jan 2002 16:52:33 -0500 (EST)
Message-ID: <3C3CBBA0.1010409@mit.edu>
Date: Wed, 09 Jan 2002 16:52:32 -0500
From: Jacob Morzinski <jmorzins@MIT.EDU>
Reply-To: sipb@MIT.EDU
User-Agent: Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv:0.9.7) Gecko/20011221
X-Accept-Language: en-us
MIME-Version: 1.0
To: Keyuan Xu <keyuan82@hotmail.com>
CC: sipb@mit.edu
Subject: Re: java question
References: <LAW2-F109VmnK28KAVu0001c44b@hotmail.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

I don't know much about Java, so a more experienced person might write 
back to correct me.  However, I believe that you won't be able to do 
this using Java.

To be able to record _all_ key events and _all_ mouse events, you'd have 
to have some code running at or near the level of the keyboard and mouse 
device drivers.  Java tries hard to be platform agnostic, and I don't 
think the JRE has enough windows-specific knowledge to know how to 
insert code into Windows at such a deep level.


Regards,
  Jacob Morzinski
  MIT SIPB


Keyuan Xu wrote:

> I am writing a java program, and I was wondering if you guys can help me 
> with a problem I am having.  I am writing a program that needs to detect 
> keystrokes and mouseclicks.  Right now I am using KeyListener and 
> MouseListener to keep track of all keystrokes and mouseclicks, but that 
> only handles keystrokes and mouseclicks in the window of my 
> application.  How can I detect global keystrokes and mouseclicks?  I 
> want to be able to open another application (say Notepad) and have my 
> application detect all the keystrokes occuring within that program.


