Most of BenQ monitors have the “Input Auto Switch” option.
By enabling “Input Auto Switch”, your monitor automatically chooses the best active input source based on all the input devices currently connected to the monitor. For example, if your monitor is connected only through HDMI, it will set the input source to HDMI automatically. If your monitor is connected through both VGA and HDMI, it will set the input source to HDMI (which has higher priority than VGA).
Please refer to the User Manual of your BenQ monitor for detailed instructions on how to use “Input Auto Switch”.