By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,946 Members | 712 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,946 IT Pros & Developers. It's quick & easy.

PrintScreen Key Event gets changed after we've made it a Citrix published application

P: n/a
I have posted this to the Citrix Developers' forum and have not heard
anything yet. So I'd like to see if any other Java developers have
experience this problem with their Java application in a Citrix Published
application environment.

We are running Citrix XP enterprise feature release 2 on windows 2000 server
sp4. We developed a Java application which can catch the "PrintScreen" key
event released event correctly in our PC but could not catch it after we
made it a Citric Published application and run it through the Citrix
Published Application Icon.
I used a simple test program to catch every key pressed, key released and
key typed event and displayed their key codes. I found out a Citrix
published application will interprete the "Printscreen" Key as key code 154
on a PC running Windows XP. But interpretes the same key as key code 17 when
running as a Citrix published application. Below is my results of the two
tests, by pressing the "Printscreen" key
PC:
KeyReleased Event java.awt.event.KeyEvent[KEY_RELEASED,keyCode=154,Print
Screen] on frame0

Citrix:
KeyPressed Event java.awt.event.KeyEvent[KEY_PRESSED,keyCode=17,keyChar='?']
on frame0
KeyReleased Event
java.awt.event.KeyEvent[KEY_RELEASED,keyCode=17,keyChar='?'] on frame0

One more additional twist, PC can only catch the KeyReleased event. Citrix
can catch the KeyPressed and KeyReleased event but does not interprete it as
154.

Does any other Citrix users and Java developers have any insight to this?

Here is my simple Java test program, if anyone wants to see.

public class PrtScr extends JFrame implements KeyListener {
PrintWriter out;

public PrtScr() {
pack();
setSize(500, 500);

setDefaultCloseOperation(EXIT_ON_CLOSE);

try {
out = new PrintWriter(new BufferedWriter(new FileWriter("foo.txt")));

out.println("PrtScr starts: ");
addKeyListener(this);

} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
//out.close();
}

}

public void keyPressed(KeyEvent e) {
System.out.println(e);
out.println("KeyPressed Event " + e.toString());
out.flush();
}

public void keyReleased(KeyEvent e) {
System.out.println(e);
out.println("KeyReleased Event " + e.toString());
out.flush();
}

public void keyTyped(KeyEvent e) {
System.out.println(e);
out.println("KeyTyped Event " + e.toString());
out.flush();
}

public static void main(String[] args) {
PrtScr frame = new PrtScr();
frame.setVisible(true);
}
}

Thanks.

Jul 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.