Article View: borland.public.jbuilder.java.language
Article #19772Re: F1-F12 pressed()?
From: Uday Pai
Date: Thu, 11 Dec 1997 00:00
Date: Thu, 11 Dec 1997 00:00
48 lines
1290 bytes
1290 bytes
Sample Code:
class JDraftFrame_KeyListener extends KeyAdapter
{
private JDraftFrame target;
public JDraftFrame_KeyListener(JDraftFrame targ)
{
target = targ;
}
public void keyPressed(KeyEvent event)
{
Object obj = event.getSource();
switch(event.getKeyCode())
{
case KeyEvent.VK_U: // CTRL+U
xxx
break;
case KeyEvent.VK_R: // CTRL+R
xxxx
break;
case KeyEvent.VK_1: // CTRL+1
xxx
break;
case KeyEvent.VK_2: // CTRL+2
xxx
break;
}
}
Ingmar Bode wrote:
> Hello,
>
> I'm using a decorated frame with some textfields and buttons dropped on
> it.
> I would like my code to recognize whenever the user presses the function
> keys F1 - F12.
>
> I have no idea how I can do this. Could anyone please give me some
> advice?
>
> Ingmar
Technical Details
Message-ID:
<3490B9C0.D43E9E47@ionet.net>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<348FA446.59688B7B@athena.rrz.uni-koeln.de>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,30671788d609d130 X-Google-Attributes: gidf74b3,public From: Uday Pai <uday@ionet.net> Subject: Re: F1-F12 pressed()? Date: 1997/12/11 Message-ID: <3490B9C0.D43E9E47@ionet.net> X-Deja-AN: 297449677 References: <348FA446.59688B7B@athena.rrz.uni-koeln.de> To: Ingmar Bode <a2426900@athena.rrz.uni-koeln.de> Organization: ioNET Inc. Newsgroups: borland.public.jbuilder.java.language