Files
jlibwinapi/src/org/synthuse/commands/KeyboardCommands.java
Edward Jakubowski da3326a5e4 Message Hook Window is working, Added BAR sendKeys and fixed colon key.
Message Hook Window is working and will allow you to see all messages
being processed by a target window.
Had to build Message Hook Window inside the native MsgHook.dll was
having issues keep a java window's WndProc callback processing.
2014-05-27 21:59:26 -04:00

68 lines
1.4 KiB
Java

/*
* Copyright 2014, Synthuse.org
* Released under the Apache Version 2.0 License.
*
* last modified by ejakubowski
*/
package org.synthuse.commands;
import org.synthuse.*;
public class KeyboardCommands extends BaseCommand {
public KeyboardCommands(CommandProcessor commandProcessor) {
super(commandProcessor);
}
public boolean cmdSendKeys(String[] args) {
if (!checkArgumentLength(args, 1))
return false;
return whenFalseAppendError(RobotMacro.sendKeys(args[0]));
}
public boolean cmdKeyDown(String[] args) {
if (!checkArgumentLength(args, 1))
return false;
if (!checkFirstArgumentLength(args))
return false;
char keyChar = args[0].charAt(0);
return RobotMacro.keyDown(keyChar);
}
public boolean cmdKeyUp(String[] args) {
if (!checkArgumentLength(args, 1))
return false;
if (!checkFirstArgumentLength(args))
return false;
char keyChar = args[0].charAt(0);
return RobotMacro.keyUp(keyChar);
}
public boolean cmdKeyCopy(String[] args) {
RobotMacro.copyKey();
return true;
}
public boolean cmdKeyPaste(String[] args) {
RobotMacro.pasteKey();
return true;
}
public boolean cmdKeyEscape(String[] args) {
RobotMacro.escapeKey();
return true;
}
public boolean cmdKeyFunc(String[] args) {
if (!checkArgumentLength(args, 1))
return false;
if (!checkFirstArgumentLength(args))
return false;
int fNum = Integer.parseInt(args[0]);
RobotMacro.functionKey(fNum);
return true;
}
}