summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTim Redfern <tim@eclectronics.org>2012-01-08 23:59:10 +0000
committerTim Redfern <tim@eclectronics.org>2012-01-08 23:59:10 +0000
commitc63227ab08ef1caa5efe957d6f9472387c9481ae (patch)
treee9e4bca77b1aeb34977ead2765fc1c13af4efffb /src
parent7641fad8ebc4ba0e6412fcb7a556a705c0a6ea2c (diff)
dual controls
Diffstat (limited to 'src')
-rw-r--r--src/testApp.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/testApp.cpp b/src/testApp.cpp
index 7e448fd..2094c34 100644
--- a/src/testApp.cpp
+++ b/src/testApp.cpp
@@ -74,8 +74,8 @@ void testApp::draw(){
//--------------------------------------------------------------
void testApp::keyPressed(int key){
- //todo: 'both' mode
- views[activeView].keyPressed(key);
+ if (activeView<0) for (int i=0;i<numViews;i++) views[i].keyPressed(key);
+ else if (activeView<numViews) views[activeView].keyPressed(key);
switch (key) {
case '8':
mode=CALIBRATE;
@@ -87,18 +87,23 @@ void testApp::keyPressed(int key){
mode=NOTHING;
break;
case '1':
- activeView=0;
+ activeView=-1;
break;
case '2':
+ activeView=0;
+ break;
+ case '3':
activeView=1;
break;
+
}
}
//--------------------------------------------------------------
void testApp::keyReleased(int key){
- views[activeView].keyReleased(key);
+ if (activeView<0) for (int i=0;i<numViews;i++) views[i].keyReleased(key);
+ else if (activeView<numViews) views[activeView].keyReleased(key);
}
//--------------------------------------------------------------