So, I have some c++ source with key bindings like:
switch( keypressed )
{
case 'c':
cam_handle->Yaw(min_angle );
break;
case 'd':
cam_handle->Yaw( -min_angle );
break;
case 's':
cam_handle->Pitch(min_angle );
break;
case 'x':
cam_handle->Pitch( -min_angle );
break;
case 'z':
cam_handle->Roll( min_angle );
break;
case 'a':
cam_handle->Roll( -min_angle );
I always forget what the stupid keys are and have to guess, and they might change, or new keys get added, etc. Is there some fast way to auto-generate help or an "idiot's guide" popup that that says what the short-cuts are? In case someone doesn't know boost::program_options but can answer, here's an example of that:
int options(int ac, char ** av, Options& opts) {
// Declare the supported options.
po::options_description desc("Allowed options");
desc.add_options()
("help", "Produce help message.")
("width,w", po::value<int>(&opts.frameWidth)->default_value(640),"frame width")
("height,h", po::value<int>(&opts.frameHeight)->default_value(480),"frame height")
("port,p", po::value<string>(&opts.port)->default_value("5001"),"port");
po::variables_map vm;
po::store(po::command_line_parser(ac, av).options(desc).allow_unregistered().run(),vm);
po::notify(vm);
if (vm.count("help")) {
cout << desc << "\n";
return 1;
}
return 0;
}
So, I don't have to "RTFC" to know how to use the executable, I just say "./myapp --help" and boost has nicely auto-generated help and all that. Is there something like this for keyboard shortcut mapping, where the key strokes replace the role of commandline flags? (In C++ that is. In principle C is OK too but I doubt it could be as elegant as the boost stuff. )