achalagarwal / keystrokes

extensible and powerful framework for keystroke analysis
GNU General Public License v3.0
2 stars 0 forks source link

Type/Input a keystroke from the application to the OS #7

Open achalagarwal opened 4 years ago

achalagarwal commented 4 years ago

An important feature that requires tinkering with the OS and opens up a multitude of applications.

If I have text selected, I can fix the typos there if right-click fix isn't available, I can change all caps to small, vice versa, and/or toggle.

Just the ability to be able to internally hit backspace, type in a few keys means that we can start seeing benefits in auto-correcting mistakes

achalagarwal commented 4 years ago

On a Mac, osascript can be used to send inputs, it is slow to call the script for a single letter and also need to handle callbacks

#!/bin/bash
osascript <<EOF
tell application "System Events"
  delay 0.5
  keystroke "achalagarwal.01@gmail.com"
end tell
EOF