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
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
3 | Projection mapping mode, use this to select a surface first
4 | Source selection mode
c | Show info
i | Show info
t | Add triangle surface
q | Add quad surface
x | Add hexagon surface
g | Add grid warp surface
a | duplicate selected surface
o | Scale surface up
i | Scale surface down
d | duplicate selected surface
\+ | Scale surface up
\- | Scale surface down
p | toggle perspective warping (quad surfaces only)
v | add columns to grid surface (grid warp surfaces only)
b | remove columns from grid surface (grid warp surfaces only)
n | add rows to grid surface (grid warp surfaces only)
m | remove rows from grid surface (grid warp surfaces only)
] | add columns to grid surface (grid warp surfaces only)
[ | remove columns from grid surface (grid warp surfaces only)
} | add rows to grid surface (grid warp surfaces only)
{ | remove rows from grid surface (grid warp surfaces only)
. | select next surface (projection mapping mode only)
, | select previous surface (projection mapping mode only)
k | select next vertex
l | select previous vertex
h | Move selected surface one layer up
j | Move selected surface one layer down
\> | select next vertex
\< | select previous vertex
0 | Move selected surface one layer up
9 | Move selected surface one layer down
s | Save composition
y | Hide/show layer panel
l | Hide/show layer panel
z | Undo
rbt | Reboot (Raspberry Pi only)
sdn | Shutdown (Raspberry Pi only)
new | Clear composition (remove all surfaces)
ext | Exit application and return to command line
d | Delete surface.
w | Toggle pause for video sources (texture and projection mapping modes)
5 | Select next source (no need to use the source selection interface)
8 | Move selection Up
9 | Move selection Down
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
BACKSPACE ('\' via SSH) | Delete surface.
SPACE | Toggle pause for video sources (texture and projection mapping modes)
TAB | Select next source (no need to use the source selection interface)
Arrow keys | Move selection. If no surface is selected in the projection mapping mode, all surfaces are moved.
\/ | 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){
switch(args.key){
case 't':
app->createSurface(SurfaceType::TRIANGLE_SURFACE);
break;
case 'q':
app->createSurface(SurfaceType::QUAD_SURFACE);
break;
case 'r':
app->createSurface(SurfaceType::CIRCLE_SURFACE);
break;
break;
case 'g':
app->createSurface(SurfaceType::GRID_WARP_SURFACE);
break;
case 'x':
case 'h':
app->createSurface(SurfaceType::HEXAGON_SURFACE);
break;
case 'd':
case OF_KEY_BACKSPACE:
app->eraseSurface(app->getSurfaceManager()->getSelectedSurfaceIndex());
break;
@ -80,55 +76,55 @@ void ProjectionMappingMode::onKeyPressed(Application * app, ofKeyEventArgs & arg
app->togglePerspective();
break;
case 'n':
case '}':
app->addGridRow();
break;
case 'm':
case '{':
app->removeGridRow();
break;
case 'v':
case ']':
app->addGridColumn();
break;
case 'b':
case '[':
app->removeGridColumn();
break;
case '.':
app->selectNextSurface();
break;
case ',':
app->selectPrevSurface();
break;
case 'k':
case '>':
app->selectNextVertex();
break;
case 'l':
case '<':
app->selectPrevVertex();
break;
case '8':
case OF_KEY_UP:
if(app->isShiftKeyDown()){
app->moveSelection(ofVec2f(0.0f, -10.0f));
}else{
app->moveSelection(ofVec2f(0.0f, -1.0f));
}
break;
case '9':
case OF_KEY_DOWN:
if(app->isShiftKeyDown()){
app->moveSelection(ofVec2f(0.0f, 10.0f));
}else{
app->moveSelection(ofVec2f(0.0f, 1.0f));
}
break;
case '7':
case OF_KEY_LEFT:
if(app->isShiftKeyDown()){
app->moveSelection(ofVec2f(-10.0f, 0.0f));
}else{
@ -136,43 +132,43 @@ void ProjectionMappingMode::onKeyPressed(Application * app, ofKeyEventArgs & arg
}
break;
case '0':
case OF_KEY_RIGHT:
if(app->isShiftKeyDown()){
app->moveSelection(ofVec2f(10.0f, 0.0f));
}else{
app->moveSelection(ofVec2f(1.0f, 0.0f));
}
break;
case 'w':
case ' ':
app->togglePause();
break;
case '5':
case OF_KEY_TAB:
app->setNextSource();
break;
case 'a':
case 'd':
app->duplicateSurface();
break;
case 'h': // Move selected surface up the layer stack
case '0': // Move selected surface up the layer stack
app->moveLayerUp();
break;
case 'j': // Move selected surface down the layer stack
case '9': // Move selected surface down the layer stack
app->moveLayerDown();
break;
case 'o': // Scale surface up
case '+': // Scale surface up
app->scaleUp();
break;
case 'i': // Scale surface down
case '-': // Scale surface down
app->scaleDown();
break;
case 'y':
case 'l':
_bDrawLayerPanel = !_bDrawLayerPanel;
break;
@ -181,7 +177,7 @@ void ProjectionMappingMode::onKeyPressed(Application * app, ofKeyEventArgs & arg
app->getSurfaceManager()->setNextPreset();
break;
*/
default:
break;
}
@ -195,7 +191,7 @@ void ProjectionMappingMode::onMousePressed(Application * app, ofMouseEventArgs &
BaseSurface * hitSurface = 0;
hitJoint = Gui::instance()->getProjectionEditorWidget().hitTestJoints(ofVec2f(args.x, args.y));
if(hitJoint){
for(int i = Gui::instance()->getProjectionEditorWidget().getJoints()->size() - 1; i >= 0 ; --i){
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)){
//
}else if(hitJoint){
@ -234,7 +230,7 @@ void ProjectionMappingMode::onMouseReleased(Application * app, ofMouseEventArgs
Gui::instance()->getProjectionEditorWidget().stopDragJoints();
}
void ProjectionMappingMode::onMouseDragged(Application * app, ofMouseEventArgs & args){
void ProjectionMappingMode::onMouseDragged(Application * app, ofMouseEventArgs & args){
Gui::instance()->onMouseDragged(args);
Gui::instance()->getProjectionEditorWidget().mouseDragged(args);

3
src/Application/Modes/SourceSelectionMode.cpp

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

8
src/Application/Modes/TextureMappingMode.cpp

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

Loading…
Cancel
Save