-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME
42 lines (29 loc) · 1.75 KB
/
README
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
35
36
37
38
39
40
41
42
***Requires Pywin32 (https://sourceforge.net/projects/pywin32/)***
virtualkeys.py wraps up a portion of the win32api module in an effort to make
it easier for beginners to use.
Rather than calling win32api.keybd_event(dwFlag,dx,dy,dwData) and filling it
with the proper key codes (which you would have to look up on
http://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx
unless you have somekind of super memory.) I've wrapped everything in a series
of functions called called press().
To virtually push a key -- that is, one press, one release -- all you need to
call is press(*args), where the argument is a string containing the key you wish
to press. e.g. press('a','b','c'). This presses, in order, one at a time the
key names passed to it.
All keyboard functions in this module follow this theme.
The only one that doesn't is 'typer()'. This accepts whole words (or series of
words) as arguments. e.g. 'Hello World!' which it will loop through, interpret,
and press the appropriate key.
It's just more convenient than using press() and seperating each letter by a
comma. Note that this version alos catches special characters such as
'~!@#$%^&*()_+=-[]{};':",.<>/?'. I got a little too lazy to add them into the
press() function.
I've added a few commonly used functions such as Copy and Paste for direct
calling.
Finally, all mouse functions (excluding the MOUSE_WHEEL) follow this argment
style: Mouse('button'). Where button is 'left', 'middle', or 'right'.
MouseWheel takes two arguments. A directions parameter, and an'amount'
parameter. This controls how many 'clicks' and in which direction.
Note: ALL VK_CODE strings are lower case and follow the word_word style. e.g.
'caps_lock', 'left_arrow', 'print_screen', etc..
Note: Music my Pitx