From a8c4e44d390b998fcadae32d1f1489bc1bbdb605 Mon Sep 17 00:00:00 2001 From: Krisjanis Rijnieks Date: Thu, 19 Jan 2017 18:11:33 +0100 Subject: [PATCH] Add key and mouse event forwarding --- example-camera/src/ofApp.cpp | 22 +++++++++++++++++++++- example-camera/src/ofApp.h | 7 +++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/example-camera/src/ofApp.cpp b/example-camera/src/ofApp.cpp index c0a24b2..9751f39 100644 --- a/example-camera/src/ofApp.cpp +++ b/example-camera/src/ofApp.cpp @@ -13,4 +13,24 @@ void ofApp::update(){ void ofApp::draw(){ piMapper.draw(); -} \ No newline at end of file +} + +void ofApp::keyPressed(int key){ + piMapper.keyPressed(key); +} + +void ofApp::keyReleased(int key){ + piMapper.keyReleased(key); +} + +void ofApp::mousePressed(int x, int y, int button){ + piMapper.mousePressed(x, y, button); +} + +void ofApp::mouseDragged(int x, int y, int button){ + piMapper.mouseDragged(x, y, button); +} + +void ofApp::mouseReleased(int x, int y, int button){ + piMapper.mouseReleased(x, y, button); +} diff --git a/example-camera/src/ofApp.h b/example-camera/src/ofApp.h index 1f9a63b..a76db1a 100644 --- a/example-camera/src/ofApp.h +++ b/example-camera/src/ofApp.h @@ -18,6 +18,13 @@ class ofApp : public ofBaseApp { void setup(); void update(); void draw(); + + void keyPressed(int key); + void keyReleased(int key); + + void mousePressed(int x, int y, int button); + void mouseDragged(int x, int y, int button); + void mouseReleased(int x, int y, int button); ofxPiMapper piMapper; CameraSource * cameraSource;