Virtual reality can provide the means of computer interaction for disabled people. There are many methods for aiding disabled people to communicate with computer; however some of them may require high amount of processing and cannot be implemented in real-time applications. In addition, many methods may require additional equipment to be attached to the users, which can reduce freedom of movement and increase cost of the system. In this article, we propose a real time, low cost and hands free method for typing; only utilizing user's head movements. Head movement detection is done by a color-marker discrimination algorithm, which compares differences between RGB, hue and saturation components of the markers and the environment. The method has shown to be adoptable to different lighting conditions. Also, trained users showed to be able to type a text with a reasonable speed (4.5 s for each character), and with a low error rate (0.0% to 5.5%).