Created
April 10, 2015 11:35
-
-
Save A1rPun/a03361cf1c4d300d2859 to your computer and use it in GitHub Desktop.
Convert a string to keys on your keyboard
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function convertStringToInput(str){ | |
var result = []; | |
for (var i = 0, l = str.length; i < l; i++) { | |
var charCode = str.charCodeAt(i); | |
result.push(charCode > 255 ? '+' + charCode.toString(16) : charCode); | |
} | |
return result.join(' '); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment