diff --git a/.idea/aws.xml b/.idea/aws.xml
new file mode 100644
index 0000000..f64dd54
--- /dev/null
+++ b/.idea/aws.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/java/controlP5/Controller.java b/src/main/java/controlP5/Controller.java
index 2def87b..3f3a6c6 100755
--- a/src/main/java/controlP5/Controller.java
+++ b/src/main/java/controlP5/Controller.java
@@ -1197,6 +1197,7 @@ public abstract class Controller< T > implements ControllerInterface< T > , CDra
}
protected void mousePressed( ) {
+ ( (ControllerGroup>) _myParent).setActiveController(this);
}
protected void mouseReleased( ) {
diff --git a/src/main/java/controlP5/ControllerGroup.java b/src/main/java/controlP5/ControllerGroup.java
index 86bafed..53cee10 100755
--- a/src/main/java/controlP5/ControllerGroup.java
+++ b/src/main/java/controlP5/ControllerGroup.java
@@ -23,7 +23,7 @@ package controlP5;
* @modified ##date##
* @version ##version##
*
- */
+ **/
import java.util.ArrayList;
import java.util.List;
@@ -43,6 +43,9 @@ public abstract class ControllerGroup< T > implements ControllerInterface< T > ,
protected float[] positionBuffer = new float[ 2 ];
protected float[] absolutePosition = new float[ 2 ];
protected ControllerList controllers;
+
+ /* the controller that receives KeyEvents*/
+ protected Controller> activeController;
protected List< ControlListener > _myControlListener;
// protected ControlWindow _myControlWindow;
protected ControlP5 cp5;
@@ -540,11 +543,25 @@ public abstract class ControllerGroup< T > implements ControllerInterface< T > ,
}
@ControlP5.Invisible public void keyEvent( KeyEvent theEvent ) {
- for ( int i = 0 ; i < controllers.size( ) ; i++ ) {
- ( ( ControllerInterface< ? > ) controllers.get( i ) ).keyEvent( theEvent );
+ //for ( int i = 0 ; i < controllers.size( ) ; i++ ) {
+ // ( ( ControllerInterface< ? > ) controllers.get( i ) ).keyEvent( theEvent );
+ //}
+ if ( activeController != null ){
+ activeController.keyEvent(theEvent);
}
}
+ public ControllerGroup setActiveController(Controller> theController){
+ activeController = theController;
+ return this;
+ }
+
+ public Controller> getActiveController(){
+ return activeController;
+ }
+
+
+
public boolean setMousePressed( boolean theStatus ) {
if ( !isVisible ) {
return false;
diff --git a/src/main/java/controlP5/Textfield.java b/src/main/java/controlP5/Textfield.java
index 2184159..c538633 100755
--- a/src/main/java/controlP5/Textfield.java
+++ b/src/main/java/controlP5/Textfield.java
@@ -260,6 +260,8 @@ public class Textfield extends Controller< Textfield > implements ReleasedOutsid
}
@Override protected void mousePressed( ) {
+ super.mousePressed();
+
if ( isActive ) {
// TODO System.out.println("adjust cursor");
}
@@ -268,6 +270,8 @@ public class Textfield extends Controller< Textfield > implements ReleasedOutsid
// TODO System.out.println(x + ":" + y);
setFocus( true );
+
+
}
@Override public void mouseReleasedOutside( ) {
diff --git a/target/classes/controlP5/ControlEvent.class b/target/classes/controlP5/ControlEvent.class
index ac2b188..f1774d5 100644
Binary files a/target/classes/controlP5/ControlEvent.class and b/target/classes/controlP5/ControlEvent.class differ
diff --git a/target/classes/controlP5/ControlP5.class b/target/classes/controlP5/ControlP5.class
index 0546d95..a508239 100644
Binary files a/target/classes/controlP5/ControlP5.class and b/target/classes/controlP5/ControlP5.class differ
diff --git a/target/classes/controlP5/ControlP5Base.class b/target/classes/controlP5/ControlP5Base.class
index f1c0987..7619c22 100644
Binary files a/target/classes/controlP5/ControlP5Base.class and b/target/classes/controlP5/ControlP5Base.class differ
diff --git a/target/classes/controlP5/ControllerAutomator.class b/target/classes/controlP5/ControllerAutomator.class
index ea07ba4..314a132 100644
Binary files a/target/classes/controlP5/ControllerAutomator.class and b/target/classes/controlP5/ControllerAutomator.class differ
diff --git a/target/classes/controlP5/ControllerGroup.class b/target/classes/controlP5/ControllerGroup.class
index 6f79e2d..0966734 100644
Binary files a/target/classes/controlP5/ControllerGroup.class and b/target/classes/controlP5/ControllerGroup.class differ
diff --git a/target/classes/controlP5/ControllerLayout.class b/target/classes/controlP5/ControllerLayout.class
index d57ef0e..db24f7f 100644
Binary files a/target/classes/controlP5/ControllerLayout.class and b/target/classes/controlP5/ControllerLayout.class differ
diff --git a/target/classes/controlP5/Textfield$DeleteCharacter.class b/target/classes/controlP5/Textfield$DeleteCharacter.class
index a1acd4b..99fc4d5 100644
Binary files a/target/classes/controlP5/Textfield$DeleteCharacter.class and b/target/classes/controlP5/Textfield$DeleteCharacter.class differ
diff --git a/target/classes/controlP5/Textfield$Enter.class b/target/classes/controlP5/Textfield$Enter.class
index cdc7b51..6b67194 100644
Binary files a/target/classes/controlP5/Textfield$Enter.class and b/target/classes/controlP5/Textfield$Enter.class differ
diff --git a/target/classes/controlP5/Textfield$InsertCharacter.class b/target/classes/controlP5/Textfield$InsertCharacter.class
index 3367dd6..083665c 100644
Binary files a/target/classes/controlP5/Textfield$InsertCharacter.class and b/target/classes/controlP5/Textfield$InsertCharacter.class differ
diff --git a/target/classes/controlP5/Textfield$MoveDown.class b/target/classes/controlP5/Textfield$MoveDown.class
index 8c340cf..86aed9f 100644
Binary files a/target/classes/controlP5/Textfield$MoveDown.class and b/target/classes/controlP5/Textfield$MoveDown.class differ
diff --git a/target/classes/controlP5/Textfield$MoveLeft.class b/target/classes/controlP5/Textfield$MoveLeft.class
index ab48072..2a0a273 100644
Binary files a/target/classes/controlP5/Textfield$MoveLeft.class and b/target/classes/controlP5/Textfield$MoveLeft.class differ
diff --git a/target/classes/controlP5/Textfield$MoveRight.class b/target/classes/controlP5/Textfield$MoveRight.class
index 396cda8..c357a56 100644
Binary files a/target/classes/controlP5/Textfield$MoveRight.class and b/target/classes/controlP5/Textfield$MoveRight.class differ
diff --git a/target/classes/controlP5/Textfield$MoveUp.class b/target/classes/controlP5/Textfield$MoveUp.class
index c7c21cd..1801a14 100644
Binary files a/target/classes/controlP5/Textfield$MoveUp.class and b/target/classes/controlP5/Textfield$MoveUp.class differ
diff --git a/target/classes/controlP5/Textfield.class b/target/classes/controlP5/Textfield.class
index 99e7eb7..0496302 100644
Binary files a/target/classes/controlP5/Textfield.class and b/target/classes/controlP5/Textfield.class differ