I tried to make an app to help vision impaired people navigate the screen by using eye tracking. The goal was to not have to lift the hands from the keyboard. But I eventually gave up because it can be much easier done with a foot pedal.
I ordered a FS3-P USB 3 Triple Foot Switch Pedal form eBay. When connected to a computer acts as a normal USB Keyboard but with just three keys.
I used the software USB-Overdrive to run scripts when one of the pedals is pressed.
Script to activate dictation mode
tell application "System Events" set theProcess to first process whose frontmost is true tell theProcess repeat 2 times key code 63 end repeat end tell end tell