Commit e87776ab authored by slevy's avatar slevy
Browse files

New hot-keys in graphics window --

   ?      print help message for hot keys
   ctrl-S toggle stereo left/right eyes
Safer sprintf for subcam report.
parent 8b0dbefb
......@@ -187,7 +187,7 @@ void pp_cmd_cb( HistInput* inp, void * ) {
static enum Gv_Nav codes[] = { GV_FLY, GV_ORBIT, GV_ROTATE, GV_TRANSLATE };
static char *navtitles[] = {"[f]ly","[o]rbit","[r]ot","[t]ran"};
static const char *navtitles[] = {"[f]ly","[o]rbit","[r]ot","[t]ran"};
void pp_nav_init(Fl_Menu_Button *m) {
m->add("[f]ly|[o]rbit|[r]ot|[t]ran");
......@@ -352,6 +352,24 @@ void pp_play_cb( Fl_Button *play, struct stuff ** ) {
}
}
static const char *viewhelp[] = {
"[?] this help",
"<Tab> focus on command-input box",
"[f]ly [o]rbit [r]ot [t]ranslate - left-mouse-drag motion modes",
"Ctrl-left-drag: alternate (\"pan\" in orbit mode; axis-constrained in rot/trans)",
"Middle-drag (or Option-left): forward/back (orbit/fly/trans), rotate in screen plane (rot)",
"Right-click: pick object Shift-right-click: pick object, set new center",
"[p] pick object under cursor [P] pick object and set new center",
"[v] zoom out [V] zoom in (optional fovy prefix, e.g. \"42.5v\")",
"[{] animate backward [}] animate forward [~] toggle fwd/back",
"[z] 2x slower [Z] 2x faster",
"[<] step backward [>] step forward (optional delta-time prefix)",
"[s] stereo on/off (optional stereosep prefix, e.g. \"-.02s\")",
"[ctrl-s] toggle left/right eye of stereo view",
"[ctrl-t] report frame rate",
"[PrtSc] take image snapshot",
};
int pp_viewevent_cb( Fl_Gview *view, int ev ) {
char snapinfo[1024];
int fno;
......@@ -379,6 +397,11 @@ int pp_viewevent_cb( Fl_Gview *view, int ev ) {
int key = Fl::event_text()[0];
switch(key) {
case '?':
for(int i = 0; i < COUNT(viewhelp); i++)
msg(" %s", viewhelp[i]);
return 1;
case '\t':
if(!ppui.cmdhist || !ppui.cmdhist->input())
return 0;
......@@ -399,8 +422,15 @@ int pp_viewevent_cb( Fl_Gview *view, int ev ) {
} else {
parti_stereo( view->stereo()==GV_MONO ? "on" : "off" );
}
msg("stereo %s (focallen %g)",
parti_stereo(NULL), view->focallen());
msg("stereo %s (focallen %g)", parti_stereo(NULL), view->focallen());
return 1;
case CTRL('S'):
if(strstr(parti_stereo(NULL),"left"))
parti_stereo("right");
else
parti_stereo("left");
msg("stereo %s", parti_stereo(NULL));
return 1;
case '>': bump = 1; goto step;
......@@ -1003,8 +1033,8 @@ int pp_parse_args( struct stuff **, int argc, char *argv[], char *fromfname, voi
index = parti_current_subcam();
if(index > 0) {
char params[100];
char *name = parti_get_subcam( index, params );
msg("subcam %s %s # az el rol L R B T // subcam -tilt %g", name, params, ppui.sctilt);
const char *name = parti_get_subcam( index, params );
msg("subcam %.30s %.40s # az el rol L R B T // subcam -tilt %g", name, params, ppui.sctilt);
} else {
int wx, wy;
float hx, hy = .5 * parti_fovy(NULL);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment