Just another update
This commit is contained in:
parent
a25938f123
commit
00a190b0a6
6591 changed files with 94363 additions and 23227 deletions
|
|
@ -1,20 +1,26 @@
|
|||
import java.awt.Robot
|
||||
import java.awt.event.KeyEvent
|
||||
|
||||
/** Keystrokes when this function is executed will go to whatever application has focus at the time.
|
||||
* Special cases may need to be made for certain symbols, but most of
|
||||
* the VK values in KeyEvent map to the ASCII values of characters.
|
||||
*/
|
||||
|
||||
object Keystrokes extends App {
|
||||
def Keystroke(str: String) {
|
||||
val robot = new Robot();
|
||||
for (ch <- str.toCharArray()) {
|
||||
def keystroke(str: String) {
|
||||
val robot = new Robot()
|
||||
for (ch <- str) {
|
||||
if (Character.isUpperCase(ch)) {
|
||||
robot.keyPress(KeyEvent.VK_SHIFT);
|
||||
robot.keyPress(ch);
|
||||
robot.keyRelease(ch);
|
||||
robot.keyRelease(KeyEvent.VK_SHIFT);
|
||||
robot.keyPress(KeyEvent.VK_SHIFT)
|
||||
robot.keyPress(ch)
|
||||
robot.keyRelease(ch)
|
||||
robot.keyRelease(KeyEvent.VK_SHIFT)
|
||||
} else {
|
||||
val upCh = Character.toUpperCase(ch);
|
||||
robot.keyPress(upCh);
|
||||
robot.keyRelease(upCh);
|
||||
val upCh = Character.toUpperCase(ch)
|
||||
robot.keyPress(upCh)
|
||||
robot.keyRelease(upCh)
|
||||
}
|
||||
}
|
||||
}
|
||||
keystroke(args(0))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue