Article View: borland.public.jbuilder.java.language
Article #16361What's the keyChar for (Alt) and (Print Screen)
From: peter theophanous
Date: Wed, 03 Mar 1999 00:00
Date: Wed, 03 Mar 1999 00:00
23 lines
1570 bytes
1570 bytes
I'm trying to simulate the KeyEvent for (Alt)(PrintScreen)
I have code working but can't figure out how to set the correct
value for keyChar. Does anyone know the keyChar values for
the (Alt) and (PrintScreen) keys? Below is the code I use.
thanks
--------------------------------------------------------
System.out.println("!!! COPY to clipboard !!!");
long evtTime = System.currentTimeMillis();
keyCode = KeyEvent.VK_ALT; // ALT keyCode
keyChar = KeyEvent.VK_ALT; // ?????????????????????? <<<<<<<<
KeyEvent evt1 = new KeyEvent(this, KeyEvent.KEY_RELEASED,
evtTime, KeyEvent.KEY_RELEASED, keyCode, keyChar);
dispatchEvent(evt1);
keyCode = KeyEvent.VK_PRINTSCREEN; // PRINTSCREEN keyCode
keyChar = KeyEvent.VK_PRINTSCREEN; // ??????????????????? <<<<
KeyEvent evt2 = new KeyEvent(this, KeyEvent.KEY_RELEASED,
evtTime, KeyEvent.KEY_RELEASED, keyCode, keyChar);
dispatchEvent(evt2);
System.out.println("!!! ALT PRINTSCREEN Events sent !!!");
--------------------------------------------------------
Technical Details
Message-ID:
<36DDCE3C.E838ECB3@us.ibm.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,8858fdac69e6433,start X-Google-Attributes: gidf74b3,public From: peter theophanous <peterth@us.ibm.com> Subject: What's the keyChar for (Alt) and (Print Screen) Date: 1999/03/03 Message-ID: <36DDCE3C.E838ECB3@us.ibm.com> X-Deja-AN: 450961760 Content-Transfer-Encoding: 7bit Organization: IBM Global Network Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.language