A key ingredient for quantum photonic technologies is an on-demand source of indistinguishable single photons. State-of-the-art indistinguishable single-photon sources typically employ resonant excitation pulses with fixed repetition rates, creating a string of single photons with predetermined arrival times. However, in future applications, an independent electronic signal from a larger quantum circuit or network will trigger the generation of an indistinguishable photon. Further, operating the photon source up to the limit imposed by its lifetime is desirable. Here, we report on the application of a true on-demand approach in which we can electronically trigger the precise arrival time of a single photon as well as control the excitation pulse duration based on resonance fluorescence from a single InAs/GaAs quantum dot. We investigate in detail the effect of the finite duration of an excitation $\pi$ pulse on the degree of photon antibunching. Finally, we demonstrate that highly indistinguishable single photons can be generated using this on-demand approach, enabling maximum flexibility for future applications.