I am taking a quote from the http://www.orbiter-forum.com/showthread.php?p=118061&postcount=9:
The point behind this was to emulate the joystic control by mouse, allowing us to control airfoils (which is not possible using keyboard numpad (which is lacked on laptops anyways)) and rcs.
In the original post there is a plugin attached, it provides fair usability but could be enriched with features and further finetuned.
To sump up, I request flight by mouse features for Orbiter, which could include different options for keybinding (to not to interfere with other addons), or dialogue input like OGLA has to define options; a small icon or bars to indicate the position and scrolling; an ability to apply 0.1 or 0.5 factor to controls for more precise maneuvers (for instance, Blender's feature: hitting shift while translating, rotating or scaling gives you 0.1 factor from the original mouse movement); possibly, an option to define which controls to affect (AF, RCS, both).
Global joystic emulation or additional hardware is not really an argument to give up on this feature.
Quick and dirty: Dump the .dll in the modules\plugin folder, activate it in the launch pad. Press ALT+M to toggle between mouse input/keyboard input. Only supports rotational RCS mode+Atmospheric control surfaces. Hold down left mouse button for yaw.
Code:#define STRICT #define ORBITER_MODULE #include <orbitersdk.h> HWND hwnd = 0; float width, height; bool enable = false; NOTEHANDLE title; DLLCLBK void opcOpenRenderViewport(HWND hWnd, DWORD w, DWORD h, BOOL fc) { hwnd=hWnd; width=(float)w;height=(float)h; title = oapiCreateAnnotation(false, 0.8, _V(0.0, 1.0, 0.0)); oapiAnnotationSetPos(title, 0.84, 0.06, 1.0, 0.3); oapiAnnotationSetText(title, "Attitude: Standard"); } double lpt = 0; DLLCLBK void opcPreStep(double simt, double simdt, double mjd) { if ( GetAsyncKeyState(VK_MENU) && GetAsyncKeyState(0x4D) && simt > lpt){ enable = !enable; if ( !enable ) { VESSEL * v = oapiGetFocusInterface(); DWORD cnt = v->GetThrusterCount(); THRUSTER_HANDLE th; for ( unsigned int i = 0; i < cnt; i++ ) { th = v->GetThrusterHandleByIndex(i); v->SetThrusterLevel(th, 0); } v->SetADCtrlMode(7); oapiAnnotationSetText(title, "Attitude: Standard"); }else oapiAnnotationSetText(title, "Attitude: Mouse"); lpt = simt+0.2; } if ( !enable ) return; RECT rect; POINT cpos, crpos; GetWindowRect(hwnd, &rect); GetCursorPos(&cpos); if ( cpos.x > rect.right || cpos.x < rect.left ) return; if ( cpos.y > rect.bottom || cpos.y < rect.top ) return; crpos.x = cpos.x-rect.left; crpos.y = cpos.y-rect.top; float cx = width/2.0f, cy = height/2.0f; float pi = (crpos.y-cy)/cy; float bi = (crpos.x-cx)/cx; bool mbd = GetAsyncKeyState(0x01); VESSEL * v = oapiGetFocusInterface(); int atmode = v->GetAttitudeMode(); v->SetADCtrlMode( 7 ); v->SetControlSurfaceLevel(AIRCTRL_ELEVATOR, pi); v->SetControlSurfaceLevel((mbd?AIRCTRL_RUDDER:AIRCTRL_AILERON), bi); if ( atmode == ATTMODE_ROT ){ v->SetThrusterGroupLevel((pi>0?THGROUP_ATT_PITCHUP:THGROUP_ATT_PITCHDOWN), (pi>0?pi:-pi)); v->SetThrusterGroupLevel((mbd?(bi>0?THGROUP_ATT_YAWLEFT:THGROUP_ATT_YAWRIGHT): (bi>0?THGROUP_ATT_BANKRIGHT:THGROUP_ATT_BANKLEFT)), (bi>0?bi:-bi)); }else { v->SetThrusterGroupLevel(THGROUP_ATT_PITCHUP, 0); v->SetThrusterGroupLevel(THGROUP_ATT_PITCHDOWN,0); v->SetThrusterGroupLevel(THGROUP_ATT_YAWLEFT, 0); v->SetThrusterGroupLevel(THGROUP_ATT_YAWRIGHT, 0); v->SetThrusterGroupLevel(THGROUP_ATT_BANKLEFT, 0); v->SetThrusterGroupLevel(THGROUP_ATT_BANKRIGHT,0); } if ( !mbd ) { v->SetControlSurfaceLevel(AIRCTRL_RUDDER, 0); if ( atmode == ATTMODE_ROT ){ v->SetThrusterGroupLevel(THGROUP_ATT_YAWLEFT, 0); v->SetThrusterGroupLevel(THGROUP_ATT_YAWRIGHT, 0); } }else { v->SetControlSurfaceLevel(AIRCTRL_AILERON, 0); if ( atmode == ATTMODE_ROT ){ v->SetThrusterGroupLevel(THGROUP_ATT_BANKLEFT, 0); v->SetThrusterGroupLevel(THGROUP_ATT_BANKRIGHT, 0); } } v->SetADCtrlMode(0); }
The point behind this was to emulate the joystic control by mouse, allowing us to control airfoils (which is not possible using keyboard numpad (which is lacked on laptops anyways)) and rcs.
In the original post there is a plugin attached, it provides fair usability but could be enriched with features and further finetuned.
To sump up, I request flight by mouse features for Orbiter, which could include different options for keybinding (to not to interfere with other addons), or dialogue input like OGLA has to define options; a small icon or bars to indicate the position and scrolling; an ability to apply 0.1 or 0.5 factor to controls for more precise maneuvers (for instance, Blender's feature: hitting shift while translating, rotating or scaling gives you 0.1 factor from the original mouse movement); possibly, an option to define which controls to affect (AF, RCS, both).
Global joystic emulation or additional hardware is not really an argument to give up on this feature.