-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathosxautomation.h
34 lines (30 loc) · 1.06 KB
/
osxautomation.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
void processCommand(const char *cmd);
void print_msg(const char *msg);
CGPoint mouseLoc();
CGEventType getMouseButton(int btn, int btnState);
void mouseEvent(int btn, int btnState, int clickType);
void mouseMove(int posX, int posY);
void mouseMoveTo(int posX, int posY, float speed);
void mousePress(int btn, int clickType);
void mouseRelease(int btn, int clickType);
void mouseClick(int btn, int clickType);
void mouseDrag(int btn, int posX, int posY);
void typeString(char *str);
void keyHit(CGKeyCode kc, CGEventFlags flags);
void keyPress(CGKeyCode kc, CGEventFlags flags);
void keyRelease(CGKeyCode kc, CGEventFlags flags);
void toKey(CGKeyCode kc, CGEventFlags flags, bool upOrDown);
// iGetKey crap
typedef struct {
short kchrID;
Str255 KCHRname;
short transtable[256];
} Ascii2KeyCodeTable;
enum {
kTableCountOffset = 256+2,
kFirstTableOffset = 256+4,
kTableSize = 128
};
static OSStatus InitAscii2KeyCodeTable(Ascii2KeyCodeTable* ttable);
static short AsciiToKeyCode(Ascii2KeyCodeTable* ttable, short asciiCode);
static char KeyCodeToAscii(short virtualKeyCode);