Inadvertent activation of a portable medical device such as an ambulatory infusion pump can be reduced by locking a touchscreen of the device when it is indicated that an uninterrupted operation is to be performed. When a processor receives a device operation input from the touchscreen that indicates an uninterrupted operation is to be performed on the portable device, the touchscreen is automatically locked such that touch input at the touchscreen is not processed by the processor to navigate between or among menu screens or set pump parameters. Following completion of the uninterrupted operation, the touchscreen can be unlocked. In one embodiment, the touchscreen can be unlocked by selection of an unlock icon on the touchscreen.