🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: aus.computers.java
Article #1023

KeyListener question

#1023
From: Aidan Marks
Date: Mon, 20 Sep 1999 00:00
14 lines
1047 bytes
How do I implement a KeyListener event to trap function keys (say F1 for
help) in a java dos application and peform some action?

I found this demo code, but generates weird errors (using MS VJ++ 6.0):

class MyKeyListener implements KeyListener{
    keyTyped(KeyEvent e){
        if (e.getKeyCode() == KeyEvent.VK_ENTER) {
            // do something
        }
    }
}

Thoughts?
Technical Details
Message-ID: <eYnF3.20$Q03.3589@nsw.nnrp.telstra.net>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10d6db,eb8024a0664417c3,start
X-Google-Attributes: gid10d6db,public
From: "Aidan Marks" <aidan@free.net.au>
Subject: KeyListener question
Date: 1999/09/20
Message-ID: <eYnF3.20$Q03.3589@nsw.nnrp.telstra.net>
X-Deja-AN: 527380091
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
X-Complaints-To: abuse@telstra.net
X-Trace: nsw.nnrp.telstra.net 937823114 203.10.105.155 (Mon, 20 Sep 1999 20:25:14 EST)
Organization: Customer of Telstra Big Pond Direct
X-MSMail-Priority: Normal
NNTP-Posting-Date: Mon, 20 Sep 1999 20:25:14 EST
Newsgroups: aus.computers.java