Method and system for generating a control signal for operating a medical device using an input device located in a determined environment, wherein the input device comprises an input sensor for generating instructions for the medical device. The method comprises identifying the orientation or location of the input device in the determined environment generating a parameter linked to the identified location or orientation of the input device in the determined environment; using the identified orientation of the medical device or the identified location of the input device to identify a relative orientation of the input device with respect to the medical device; generating a parameter linked to said relative orientation of the input device with respect to the medical device; using the input device to generate an input signal relating to an instruction for the medical device; and using the input signal in combination with the parameter to obtain the control signal for the medical device.