Skip to content
/ str2key Public

Converts ASCII string(s) to keys (scan codes) for Windows 11 in commandline (for scripting)

Notifications You must be signed in to change notification settings

333van/str2key

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

str2key

A script to convert string into scan codes for windows 11 in C. In another words, it simulate keyboard inputs based on string.

build

gcc str2key.c -I./ -o str2key

usage

# PowerShell
${ String to be converted into scan codes } = "Hello World!"
${ Sleep Time in Seconds before calling SendInput() from Windows OS } = 3

str2key.exe `
${ String to be converted into scan codes } `
${ Sleep Time in Seconds before calling SendInput() from Windows OS }

# Newline will be treated as Enter
# The second param is the default sleep time, which is 3 seconds
str2key.exe @"
echo "Hello"
echo "World"

"@ 3

Special Escape in PowerShell

  • for double quotation mark, say:
str2key '""Hello World!""' 0 # "Hello World"
str2key @'
"""Hello World!"""
'@ 0 # "Hello World"
  • for backtick
str2key "``" 0
str2key @"
``
"@ 0

license

MIT

About

Converts ASCII string(s) to keys (scan codes) for Windows 11 in commandline (for scripting)

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages