Three-variants: Press and hold, press-twice, or dedicated secondary lock keys. Cover labeling of the modifier key and the individual keys: show the correct mode for virtual keypads, never caps labels when in lower-case, put the shifted label above it and gray if needed, as on a hardware keypad, etc. Make sure to keep consistent: avoid having one lock key and the rest use press-twice, but if you do then make sure there's a reason like access to the fn number pad is needed sometimes; never switch modes between virtual and hardware keyboards, or when you switch between keypad and keyboard, etc.
ABOVE IS WRONG!
Make sure to mention finger-as-stylus inputs. Just emerging, but technically possible to do much the same with letter and handwriting recognition.
Value in standing, moving, difficult environments, or for populations (or cultures) with little or no experience with keyboard entry, or no standard keyboard for the data type...