mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
requestFocus() out of PSurface, key events firing in FX
This commit is contained in:
@@ -108,9 +108,9 @@ public interface PSurface {
|
||||
|
||||
public void setFrameRate(float fps);
|
||||
|
||||
// called on the first frame so that the now-visible drawing surface can
|
||||
// receive key and mouse events
|
||||
public void requestFocus();
|
||||
// // called on the first frame so that the now-visible drawing surface can
|
||||
// // receive key and mouse events
|
||||
// public void requestFocus();
|
||||
|
||||
// // finish rendering to the screen (called by PApplet)
|
||||
// public void blit();
|
||||
|
||||
@@ -111,7 +111,7 @@ public class PSurfaceAWT extends PSurfaceNone {
|
||||
* invokeLater() happens in here rather than requiring the caller to wrap it.
|
||||
*/
|
||||
@Override
|
||||
public void requestFocus() {
|
||||
void requestFocus() {
|
||||
// for 2.0a6, moving this request to the EDT
|
||||
EventQueue.invokeLater(new Runnable() {
|
||||
public void run() {
|
||||
|
||||
@@ -115,6 +115,7 @@ public class PSurfaceFX implements PSurface {
|
||||
|
||||
EventHandler<KeyEvent> keyHandler = new EventHandler<KeyEvent>() {
|
||||
public void handle(KeyEvent e) {
|
||||
System.out.println(e);
|
||||
fxKeyEvent(e);
|
||||
}
|
||||
};
|
||||
@@ -231,6 +232,7 @@ public class PSurfaceFX implements PSurface {
|
||||
Platform.runLater(new Runnable() {
|
||||
public void run() {
|
||||
stage.show();
|
||||
canvas.requestFocus();
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -408,11 +410,10 @@ public class PSurfaceFX implements PSurface {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void requestFocus() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
// @Override
|
||||
// public void requestFocus() {
|
||||
// canvas.requestFocus();
|
||||
// }
|
||||
|
||||
|
||||
public void setCursor(int kind) {
|
||||
|
||||
@@ -141,7 +141,7 @@ public class PSurfaceNone implements PSurface {
|
||||
|
||||
}
|
||||
|
||||
public void requestFocus() {
|
||||
void requestFocus() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user