We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › WINDOW THAT LOOSES FOCUS
Page Index Toggle Pages: 1
WINDOW THAT LOOSES FOCUS? (Read 330 times)
WINDOW THAT LOOSES FOCUS?
May 16th, 2006, 4:43pm
 
Hi everyone,

I have an application exported into an .exe which hides the cursor using noCursor(); and replaces it with another cursor (customized one)…

This works perfectly when it runs on my laptop, using only one monitor.

But this application must run in a 2nd monitor, and both monitors must share an extended desktop. I'm on a PC.

OK, I run the .exe and drag it to the 2nd monitor.

The problem comes here, in the moment that I “rollout” the application and “rollover” it again because, in that moment, the application doesn’t hide the cursor, and it shows both cursors: the one by default, and the customized one.
The interactivity continues there, it is: I can get mouseX and mouseY but I cannot hide the cursor: noCursor(); doesn’t work.

I highlight “rollout” and “rollover” because this problem doesn’t occur when I click outside the application and then click inside the application (it is, explicitly loosing and gaining the focus). Once I click on the application, it hides the cursor correctly.

I don’t know Java but still I’m trying these methods:

Code:

public void focusGained(java.awt.event.FocusEvent e) {
print("\ngained: "+e);
}

public void focusLost(java.awt.event.FocusEvent e) {
print("\nlost: "+e);
}


They are invoked when I click outside the application and then click inside the application. Good.
They are not invoked when I rollout and rollover the application.


Also I have tried these methods:

Code:

public void mouseEntered(java.awt.event.MouseEvent e) {
print("\nmouse Entered: "+e);
}
public void mouseExited(java.awt.event.MouseEvent e) {
print("\nmouse Exited: "+e);
}

They are invoked when I rollout and rollover the application.

How can I solve this problem? I guess It has something to do with the focus that’s why I have been going in that way….

Would be there anyway to say something like:

Code:

public void mouseEntered(java.awt.event.MouseEvent e) {
print("\nmouse Entered: "+e);
requestFocusInWindow();
}


Thanks a lot,

Natalia Rojas
Page Index Toggle Pages: 1