Re: Capturing all KeyEvents in the system
From: Babu Kalakrishnan (k.a.l.a_at_sankya.com)
Date: 10/28/04
- Previous message: Paul Lutus: "Re: Scrolling a panel"
- In reply to: Kannan S: "Re: Capturing all KeyEvents in the system"
- Next in thread: Kannan S: "Re: Capturing all KeyEvents in the system"
- Reply: Kannan S: "Re: Capturing all KeyEvents in the system"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 28 Oct 2004 11:00:39 +0530
Kannan S wrote:
>
> class MyFrame extends JFrame {
>
> public boolean handleEvent(Event event) {
>
> if(event.id == Event.KEY_PRESS) {
> System.out.println("KeyPressed: " + event.key);
> } else if(event.id == Event.KEY_RELEASE) {
> System.out.println("KeyReleased: " + event.key);
> }
>
> return super.handleEvent(event);
> }
> }
The handleEvent method was the JDK 1.0 way of processing events and was
replaced by dispatchEvent/processEvent in 1.1. As far as I could see
from JDK 1.4 sources, no events are passed to the handleEvent method.
Did you try overriding the processEvent method instead ?
BK
- Previous message: Paul Lutus: "Re: Scrolling a panel"
- In reply to: Kannan S: "Re: Capturing all KeyEvents in the system"
- Next in thread: Kannan S: "Re: Capturing all KeyEvents in the system"
- Reply: Kannan S: "Re: Capturing all KeyEvents in the system"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]