Browse Source

Change back keyboard shortcuts to the ones before

master
Krisjanis Rijnieks 8 years ago
parent
commit
6cdbbe7e5b
  1. 53
      README.md
  2. 78
      src/Application/Modes/ProjectionMappingMode.cpp
  3. 3
      src/Application/Modes/SourceSelectionMode.cpp
  4. 8
      src/Application/Modes/TextureMappingMode.cpp

53
README.md

@ -25,6 +25,15 @@ You can use the example application of the addon for projection mapping projects
``` ```
## Compiling on Linux
There might be issues with compiling because `ofxOMXPlayer` and `ofxRPiCameraVideoGrabber` addons do not exist on Linux and also other non-RPi platforms. To avoid the issues, do the following.
1. Open `example/addons.make` and remove ofxOMXPlayer line.
2. Open `example-camera/addons.make` and remove ofxRPiCameraVideoGrabber line.
3. Compile one or both examples by using make.
## Problems with Audio ## Problems with Audio
If you are having problems with audio playback, here are two steps for you. Before you do these, make sure audio of your video file works. If you are having problems with audio playback, here are two steps for you. Before you do these, make sure audio of your video file works.
@ -153,41 +162,33 @@ Key | Function
2 | Texture editing mode 2 | Texture editing mode
3 | Projection mapping mode, use this to select a surface first 3 | Projection mapping mode, use this to select a surface first
4 | Source selection mode 4 | Source selection mode
c | Show info i | Show info
t | Add triangle surface t | Add triangle surface
q | Add quad surface q | Add quad surface
x | Add hexagon surface
g | Add grid warp surface g | Add grid warp surface
a | duplicate selected surface d | duplicate selected surface
o | Scale surface up \+ | Scale surface up
i | Scale surface down \- | Scale surface down
p | toggle perspective warping (quad surfaces only) p | toggle perspective warping (quad surfaces only)
v | add columns to grid surface (grid warp surfaces only) ] | add columns to grid surface (grid warp surfaces only)
b | remove columns from grid surface (grid warp surfaces only) [ | remove columns from grid surface (grid warp surfaces only)
n | add rows to grid surface (grid warp surfaces only) } | add rows to grid surface (grid warp surfaces only)
m | remove rows from grid surface (grid warp surfaces only) { | remove rows from grid surface (grid warp surfaces only)
. | select next surface (projection mapping mode only) . | select next surface (projection mapping mode only)
, | select previous surface (projection mapping mode only) , | select previous surface (projection mapping mode only)
k | select next vertex \> | select next vertex
l | select previous vertex \< | select previous vertex
h | Move selected surface one layer up 0 | Move selected surface one layer up
j | Move selected surface one layer down 9 | Move selected surface one layer down
s | Save composition s | Save composition
y | Hide/show layer panel l | Hide/show layer panel
z | Undo z | Undo
rbt | Reboot (Raspberry Pi only) rbt | Reboot (Raspberry Pi only)
sdn | Shutdown (Raspberry Pi only) sdn | Shutdown (Raspberry Pi only)
new | Clear composition (remove all surfaces) new | Clear composition (remove all surfaces)
ext | Exit application and return to command line ext | Exit application and return to command line
d | Delete surface. BACKSPACE ('\' via SSH) | Delete surface.
w | Toggle pause for video sources (texture and projection mapping modes) SPACE | Toggle pause for video sources (texture and projection mapping modes)
5 | Select next source (no need to use the source selection interface) TAB | Select next source (no need to use the source selection interface)
8 | Move selection Up Arrow keys | Move selection. If no surface is selected in the projection mapping mode, all surfaces are moved.
9 | Move selection Down \/ | Toggle 1px/10px steps for keyboard moves on Raspberry Pi
7 | Move selection Left
0 | Move selection Right
If no surface is selected in the projection mapping mode, all surfaces are moved.
Dont know if this works already:
\/ | Toggle 1px/10px steps for keyboard moves on Raspberry Pi

78
src/Application/Modes/ProjectionMappingMode.cpp

@ -51,28 +51,24 @@ void ProjectionMappingMode::draw(Application * app){
void ProjectionMappingMode::onKeyPressed(Application * app, ofKeyEventArgs & args){ void ProjectionMappingMode::onKeyPressed(Application * app, ofKeyEventArgs & args){
switch(args.key){ switch(args.key){
case 't': case 't':
app->createSurface(SurfaceType::TRIANGLE_SURFACE); app->createSurface(SurfaceType::TRIANGLE_SURFACE);
break; break;
case 'q': case 'q':
app->createSurface(SurfaceType::QUAD_SURFACE); app->createSurface(SurfaceType::QUAD_SURFACE);
break; break;
case 'r':
app->createSurface(SurfaceType::CIRCLE_SURFACE);
break;
case 'g': case 'g':
app->createSurface(SurfaceType::GRID_WARP_SURFACE); app->createSurface(SurfaceType::GRID_WARP_SURFACE);
break; break;
case 'x': case 'h':
app->createSurface(SurfaceType::HEXAGON_SURFACE); app->createSurface(SurfaceType::HEXAGON_SURFACE);
break; break;
case 'd': case OF_KEY_BACKSPACE:
app->eraseSurface(app->getSurfaceManager()->getSelectedSurfaceIndex()); app->eraseSurface(app->getSurfaceManager()->getSelectedSurfaceIndex());
break; break;
@ -80,55 +76,55 @@ void ProjectionMappingMode::onKeyPressed(Application * app, ofKeyEventArgs & arg
app->togglePerspective(); app->togglePerspective();
break; break;
case 'n': case '}':
app->addGridRow(); app->addGridRow();
break; break;
case 'm': case '{':
app->removeGridRow(); app->removeGridRow();
break; break;
case 'v': case ']':
app->addGridColumn(); app->addGridColumn();
break; break;
case 'b': case '[':
app->removeGridColumn(); app->removeGridColumn();
break; break;
case '.': case '.':
app->selectNextSurface(); app->selectNextSurface();
break; break;
case ',': case ',':
app->selectPrevSurface(); app->selectPrevSurface();
break; break;
case 'k': case '>':
app->selectNextVertex(); app->selectNextVertex();
break; break;
case 'l': case '<':
app->selectPrevVertex(); app->selectPrevVertex();
break; break;
case '8': case OF_KEY_UP:
if(app->isShiftKeyDown()){ if(app->isShiftKeyDown()){
app->moveSelection(ofVec2f(0.0f, -10.0f)); app->moveSelection(ofVec2f(0.0f, -10.0f));
}else{ }else{
app->moveSelection(ofVec2f(0.0f, -1.0f)); app->moveSelection(ofVec2f(0.0f, -1.0f));
} }
break; break;
case '9': case OF_KEY_DOWN:
if(app->isShiftKeyDown()){ if(app->isShiftKeyDown()){
app->moveSelection(ofVec2f(0.0f, 10.0f)); app->moveSelection(ofVec2f(0.0f, 10.0f));
}else{ }else{
app->moveSelection(ofVec2f(0.0f, 1.0f)); app->moveSelection(ofVec2f(0.0f, 1.0f));
} }
break; break;
case '7': case OF_KEY_LEFT:
if(app->isShiftKeyDown()){ if(app->isShiftKeyDown()){
app->moveSelection(ofVec2f(-10.0f, 0.0f)); app->moveSelection(ofVec2f(-10.0f, 0.0f));
}else{ }else{
@ -136,43 +132,43 @@ void ProjectionMappingMode::onKeyPressed(Application * app, ofKeyEventArgs & arg
} }
break; break;
case '0': case OF_KEY_RIGHT:
if(app->isShiftKeyDown()){ if(app->isShiftKeyDown()){
app->moveSelection(ofVec2f(10.0f, 0.0f)); app->moveSelection(ofVec2f(10.0f, 0.0f));
}else{ }else{
app->moveSelection(ofVec2f(1.0f, 0.0f)); app->moveSelection(ofVec2f(1.0f, 0.0f));
} }
break; break;
case 'w': case ' ':
app->togglePause(); app->togglePause();
break; break;
case '5': case OF_KEY_TAB:
app->setNextSource(); app->setNextSource();
break; break;
case 'a': case 'd':
app->duplicateSurface(); app->duplicateSurface();
break; break;
case 'h': // Move selected surface up the layer stack case '0': // Move selected surface up the layer stack
app->moveLayerUp(); app->moveLayerUp();
break; break;
case 'j': // Move selected surface down the layer stack case '9': // Move selected surface down the layer stack
app->moveLayerDown(); app->moveLayerDown();
break; break;
case 'o': // Scale surface up case '+': // Scale surface up
app->scaleUp(); app->scaleUp();
break; break;
case 'i': // Scale surface down case '-': // Scale surface down
app->scaleDown(); app->scaleDown();
break; break;
case 'y': case 'l':
_bDrawLayerPanel = !_bDrawLayerPanel; _bDrawLayerPanel = !_bDrawLayerPanel;
break; break;
@ -181,7 +177,7 @@ void ProjectionMappingMode::onKeyPressed(Application * app, ofKeyEventArgs & arg
app->getSurfaceManager()->setNextPreset(); app->getSurfaceManager()->setNextPreset();
break; break;
*/ */
default: default:
break; break;
} }
@ -195,7 +191,7 @@ void ProjectionMappingMode::onMousePressed(Application * app, ofMouseEventArgs &
BaseSurface * hitSurface = 0; BaseSurface * hitSurface = 0;
hitJoint = Gui::instance()->getProjectionEditorWidget().hitTestJoints(ofVec2f(args.x, args.y)); hitJoint = Gui::instance()->getProjectionEditorWidget().hitTestJoints(ofVec2f(args.x, args.y));
if(hitJoint){ if(hitJoint){
for(int i = Gui::instance()->getProjectionEditorWidget().getJoints()->size() - 1; i >= 0 ; --i){ for(int i = Gui::instance()->getProjectionEditorWidget().getJoints()->size() - 1; i >= 0 ; --i){
if((*Gui::instance()->getProjectionEditorWidget().getJoints())[i] == hitJoint){ if((*Gui::instance()->getProjectionEditorWidget().getJoints())[i] == hitJoint){
@ -211,7 +207,7 @@ void ProjectionMappingMode::onMousePressed(Application * app, ofMouseEventArgs &
} }
} }
} }
if(Gui::instance()->getScaleWidget().inside(args.x, args.y)){ if(Gui::instance()->getScaleWidget().inside(args.x, args.y)){
// //
}else if(hitJoint){ }else if(hitJoint){
@ -234,7 +230,7 @@ void ProjectionMappingMode::onMouseReleased(Application * app, ofMouseEventArgs
Gui::instance()->getProjectionEditorWidget().stopDragJoints(); Gui::instance()->getProjectionEditorWidget().stopDragJoints();
} }
void ProjectionMappingMode::onMouseDragged(Application * app, ofMouseEventArgs & args){ void ProjectionMappingMode::onMouseDragged(Application * app, ofMouseEventArgs & args){
Gui::instance()->onMouseDragged(args); Gui::instance()->onMouseDragged(args);
Gui::instance()->getProjectionEditorWidget().mouseDragged(args); Gui::instance()->getProjectionEditorWidget().mouseDragged(args);

3
src/Application/Modes/SourceSelectionMode.cpp

@ -33,4 +33,5 @@ void SourceSelectionMode::draw(Application * app){
} }
} // namespace piMapper } // namespace piMapper
} // namespace ofx } // namespace ofx

8
src/Application/Modes/TextureMappingMode.cpp

@ -103,7 +103,7 @@ void TextureMappingMode::onKeyPressed(Application * app, ofKeyEventArgs & args){
case '>': case '>':
app->selectNextTexCoord(); app->selectNextTexCoord();
break; break;
case '<': case '<':
app->selectPrevTexCoord(); app->selectPrevTexCoord();
break; break;
@ -111,7 +111,7 @@ void TextureMappingMode::onKeyPressed(Application * app, ofKeyEventArgs & args){
case ' ': case ' ':
app->togglePause(); app->togglePause();
break; break;
case OF_KEY_TAB: case OF_KEY_TAB:
app->setNextSource(); app->setNextSource();
break; break;
@ -123,7 +123,7 @@ void TextureMappingMode::onKeyPressed(Application * app, ofKeyEventArgs & args){
case '9': // Prew draw mode case '9': // Prew draw mode
app->getCmdManager()->exec(new SetTexMapDrawModeCmd( this, getPrevDrawMode() )); app->getCmdManager()->exec(new SetTexMapDrawModeCmd( this, getPrevDrawMode() ));
break; break;
} }
} }
@ -316,4 +316,4 @@ int TextureMappingMode::getPrevDrawMode(){
} }
} // namespace piMapper } // namespace piMapper
} // namespace ofx } // namespace ofx

Loading…
Cancel
Save