Recent advances in sensors and electronics have enabled electrooculogram (EOG) detection systems for capturing eye movements. However, EOG signals are susceptible to the sensor's skin-contact quality, limiting precise eye angles and gaze detection. To address this, we introduce a two-camera eye-tracking system and a data classification method for human–machine interfaces (HMIs), focusing on medical applications. Our system combines machine learning for real-time gaze and eye direction classification, achieving exceptional robotic arm control accuracy. A deep-learning algorithm is developed for eye direction classification, while the pupil center-corneal reflection method is used for gaze tracking. The system features a supervisory control and data acquisition architecture, applicable to any screen-based HMI task. We showcase the real-time control of a robotic arm in activities such as playing chess and manipulating dice, emphasizing the distinctive capabilities of our accurate eye-tracking system for diverse screen-based tasks. The system holds promise in incorporating Human-Machine Interface (HMI) into wearable devices and advanced remote-control applications in surgical robotics, healthcare support, warehouse & construction systems. Key medical benefits include: 1) enhancing surgical operations with additional control and hands-free capabilities, 2) supporting individuals limited in communication and task execution, and 3) enabling remote solutions and automating tasks to protect workers in hazardous sites and warehouses.