In the digital world, gesture recognition plays a crucial role in human-computer interaction (HCI). In this paper, we propose an innovative wearable air-writing system that allows users to write the English alphabet and Arabic numerals in free space without using any predefined gestures or rules. Based on an Inertial Measurement Unit (IMU), the proposed air-writing wearable device uses the constrained dynamic time warping (cDTW) algorithm for the distance measure and K-nearest neighbors (KNN) as the classifier. In addition, to increase the recognition accuracy and meet HCI requirements, we develop a novel method that allows users to rapidly switch to correct recognition results when the initial results are erroneous. In the experiment, the accuracy rate is 88.9% for the alphabet and 10 decimal digits in the user-dependent condition, and the recognition is in real-time, consuming only 0.427s for each character, which is superior to many other approaches that employ classic DTW or FastDTW. With the proposed HCI design, character input accuracy of over 95% can be obtained in about 1 second. We also simulated the application scenarios of Parkinson’s disease patients and obtained a high accuracy rate of 85.4%. Besides, we explored the variety of K values in KNN and w values in cDTW, and propose a multi-template system that gives new optimization directions for the KNN-cDTW algorithm.