this will achieve what you're looking for, the shift button is S4 (note that you can customize the mouse sensibility ands speed with the SetSCurve parameters)
first i define the keyboard axes mapping
then when i press S4 i force the axes to be turned into mouse
when i release S4, i force the keyboard axes mapping
KeyAxis(&Throttle, SCX, 'o', AXMAP2(3, 'l',0, 'r'));
KeyAxis(&Throttle, SCY, 'o', AXMAP2(3, 'u', 0, 'd'));
MapKey(&Joystick, S4, EXEC("MapAxis(&Throttle, SCX, MOUSE_X_AXIS, AXIS_NORMAL, MAP_RELATIVE);"
"SetSCurve(&Throttle, SCX, 0, 10, 0, 0, -5);"
"MapAxis(&Throttle, SCY, MOUSE_Y_AXIS, AXIS_NORMAL, MAP_RELATIVE);"
"SetSCurve(&Throttle, SCY, 0, 10, 0, 0, -5);"));
MapKeyR(&Joystick, S4, EXEC("KeyAxis(&Throttle, SCX, 'o', AXMAP2(3, 'l',0, 'r'));"
"KeyAxis(&Throttle, SCY, 'o', AXMAP2(3, 'u', 0, 'd'));"
"MapAxis(&Throttle, SCX, DX_XROT_AXIS);"
"MapAxis(&Throttle, SCY, DX_YROT_AXIS);"));