special_input_device 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/ext/special_input_device/_screen.c +25 -0
- data/ext/special_input_device/_screen.h +16 -0
- data/ext/special_input_device/_system_time.c +10 -0
- data/ext/special_input_device/_system_time.h +6 -0
- data/ext/special_input_device/_vendor__interception.c +331 -0
- data/ext/special_input_device/_vendor__interception.h +196 -0
- data/ext/special_input_device/color.c +25 -0
- data/ext/special_input_device/color.h +10 -0
- data/ext/special_input_device/extconf.rb +6 -0
- data/ext/special_input_device/interception_connector.c +75 -0
- data/ext/special_input_device/interception_connector.h +13 -0
- data/ext/special_input_device/keyboard.c +152 -0
- data/ext/special_input_device/mouse.c +1137 -0
- data/ext/special_input_device/point.c +17 -0
- data/ext/special_input_device/point.h +10 -0
- data/ext/special_input_device/rectangle.c +25 -0
- data/ext/special_input_device/rectangle.h +10 -0
- data/ext/special_input_device/ruby_macro.h +84 -0
- data/ext/special_input_device/screen.c +302 -0
- data/ext/special_input_device/special_input_device.c +40 -0
- data/ext/special_input_device/special_input_device.h +42 -0
- data/ext/special_input_device/win32error.c +69 -0
- data/ext/special_input_device/win32error.h +8 -0
- data/ext/special_input_device/window.c +1108 -0
- data/lib/special_input_device/attributes_equal_checker.rb +13 -0
- data/lib/special_input_device/color.rb +156 -0
- data/lib/special_input_device/image.rb +170 -0
- data/lib/special_input_device/image/bmp.rb +89 -0
- data/lib/special_input_device/image/error/damaged_image_error.rb +4 -0
- data/lib/special_input_device/image/error/image_error.rb +3 -0
- data/lib/special_input_device/image/error/unsupported_image_format_error.rb +4 -0
- data/lib/special_input_device/key_code.rb +268 -0
- data/lib/special_input_device/point.rb +48 -0
- data/lib/special_input_device/rectangle.rb +187 -0
- data/lib/special_input_device/special_input_device.rb +67 -0
- data/lib/special_input_device/table_2d.rb +157 -0
- data/stab/keyboard.rb +35 -0
- data/stab/mouse.rb +189 -0
- data/stab/screen.rb +56 -0
- data/stab/win32_error.rb +20 -0
- data/stab/window.rb +398 -0
- metadata +85 -0
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
# <code>KeyCode</code> contains lots of constant of virtual code for difference keys. If you have experience for
|
|
2
|
+
# programing in other language or you are not using an US-Keyboard, you may want to use the constant who start with
|
|
3
|
+
# <code>VK_</code>. Otherwise, it is suggested to use the constant who start with <code>KEY_</code> because it is easier
|
|
4
|
+
# to understand.
|
|
5
|
+
module SpecialInputDevice::KeyCode
|
|
6
|
+
|
|
7
|
+
KEY_BACKSPACE = 0x08 # Virtual key code of BackSpace key
|
|
8
|
+
KEY_TAB = 0x09 # Virtual key code of Tab key
|
|
9
|
+
KEY_ENTER = 0x0D # Virtual key code of Enter key
|
|
10
|
+
KEY_SHIFT = 0x10 # Virtual key code of Shift key
|
|
11
|
+
KEY_CTRL = 0x11 # Virtual key code of Control key
|
|
12
|
+
KEY_ALT = 0x12 # Virtual key code of Alternate key
|
|
13
|
+
KEY_PAUSE_BREAK = 0x13 # Virtual key code of Pause Break key
|
|
14
|
+
KEY_CAPS_LOCK = 0x14 # Virtual key code of Caps Lock key
|
|
15
|
+
KEY_ESC = 0x1B # Virtual key code of Escape key
|
|
16
|
+
KEY_SPACE = 0x20 # Virtual key code of Space key
|
|
17
|
+
KEY_PAGE_UP = 0x21 # Virtual key code of Page Up key
|
|
18
|
+
KEY_PAGE_DOWN = 0x22 # Virtual key code of Page Down key
|
|
19
|
+
KEY_END = 0x23 # Virtual key code of End key
|
|
20
|
+
KEY_HOME = 0x24 # Virtual key code of Home key
|
|
21
|
+
KEY_LEFT = 0x25 # Virtual key code of Left key
|
|
22
|
+
KEY_UP = 0x26 # Virtual key code of Up key
|
|
23
|
+
KEY_RIGHT = 0x27 # Virtual key code of Right key
|
|
24
|
+
KEY_DOWN = 0x28 # Virtual key code of Down key
|
|
25
|
+
KEY_PRINT_SCREEN_SYS_RQ = 0x2C # Virtual key code of Print Screen Sys Rq key
|
|
26
|
+
KEY_INSERT = 0x2D # Virtual key code of Insert key
|
|
27
|
+
KEY_DELETE = 0x2E # Virtual key code of Delete key
|
|
28
|
+
KEY_0 = 0x30 # Virtual key code of 0 key
|
|
29
|
+
KEY_1 = 0x31 # Virtual key code of 1 key
|
|
30
|
+
KEY_2 = 0x32 # Virtual key code of 2 key
|
|
31
|
+
KEY_3 = 0x33 # Virtual key code of 3 key
|
|
32
|
+
KEY_4 = 0x34 # Virtual key code of 4 key
|
|
33
|
+
KEY_5 = 0x35 # Virtual key code of 5 key
|
|
34
|
+
KEY_6 = 0x36 # Virtual key code of 6 key
|
|
35
|
+
KEY_7 = 0x37 # Virtual key code of 7 key
|
|
36
|
+
KEY_8 = 0x38 # Virtual key code of 8 key
|
|
37
|
+
KEY_9 = 0x39 # Virtual key code of 9 key
|
|
38
|
+
KEY_A = 0x41 # Virtual key code of A key
|
|
39
|
+
KEY_B = 0x42 # Virtual key code of B key
|
|
40
|
+
KEY_C = 0x43 # Virtual key code of C key
|
|
41
|
+
KEY_D = 0x44 # Virtual key code of D key
|
|
42
|
+
KEY_E = 0x45 # Virtual key code of E key
|
|
43
|
+
KEY_F = 0x46 # Virtual key code of F key
|
|
44
|
+
KEY_G = 0x47 # Virtual key code of G key
|
|
45
|
+
KEY_H = 0x48 # Virtual key code of H key
|
|
46
|
+
KEY_I = 0x49 # Virtual key code of I key
|
|
47
|
+
KEY_J = 0x4A # Virtual key code of J key
|
|
48
|
+
KEY_K = 0x4B # Virtual key code of K key
|
|
49
|
+
KEY_L = 0x4C # Virtual key code of L key
|
|
50
|
+
KEY_M = 0x4D # Virtual key code of M key
|
|
51
|
+
KEY_N = 0x4E # Virtual key code of N key
|
|
52
|
+
KEY_O = 0x4F # Virtual key code of O key
|
|
53
|
+
KEY_P = 0x50 # Virtual key code of P key
|
|
54
|
+
KEY_Q = 0x51 # Virtual key code of Q key
|
|
55
|
+
KEY_R = 0x52 # Virtual key code of R key
|
|
56
|
+
KEY_S = 0x53 # Virtual key code of S key
|
|
57
|
+
KEY_T = 0x54 # Virtual key code of T key
|
|
58
|
+
KEY_U = 0x55 # Virtual key code of U key
|
|
59
|
+
KEY_V = 0x56 # Virtual key code of V key
|
|
60
|
+
KEY_W = 0x57 # Virtual key code of W key
|
|
61
|
+
KEY_X = 0x58 # Virtual key code of X key
|
|
62
|
+
KEY_Y = 0x59 # Virtual key code of Y key
|
|
63
|
+
KEY_Z = 0x5A # Virtual key code of Z key
|
|
64
|
+
KEY_L_WINDOW = 0x5B # Virtual key code of Left Windows key
|
|
65
|
+
KEY_R_WINDOW = 0x5C # Virtual key code of Right Windows key
|
|
66
|
+
KEY_APPLICATIONS = 0x5D # Virtual key code of Applications key
|
|
67
|
+
KEY_NUM0 = 0x60 # Virtual key code of Numeric KeyPad 0 key
|
|
68
|
+
KEY_NUM1 = 0x61 # Virtual key code of Numeric KeyPad 1 key
|
|
69
|
+
KEY_NUM2 = 0x62 # Virtual key code of Numeric KeyPad 2 key
|
|
70
|
+
KEY_NUM3 = 0x63 # Virtual key code of Numeric KeyPad 3 key
|
|
71
|
+
KEY_NUM4 = 0x64 # Virtual key code of Numeric KeyPad 4 key
|
|
72
|
+
KEY_NUM5 = 0x65 # Virtual key code of Numeric KeyPad 5 key
|
|
73
|
+
KEY_NUM6 = 0x66 # Virtual key code of Numeric KeyPad 6 key
|
|
74
|
+
KEY_NUM7 = 0x67 # Virtual key code of Numeric KeyPad 7 key
|
|
75
|
+
KEY_NUM8 = 0x68 # Virtual key code of Numeric KeyPad 8 key
|
|
76
|
+
KEY_NUM9 = 0x69 # Virtual key code of Numeric KeyPad 9 key
|
|
77
|
+
KEY_NUM_MULTIPLICATION = 0x6A # Virtual key code of Numeric KeyPad * key
|
|
78
|
+
KEY_NUM_PLUS = 0x6B # Virtual key code of Numeric KeyPad + key
|
|
79
|
+
KEY_NUM_SUBTRACTION = 0x6D # Virtual key code of Numeric KeyPad - key
|
|
80
|
+
KEY_NUM_DOT = 0x6E # Virtual key code of Numeric KeyPad . key
|
|
81
|
+
KEY_NUM_DIVIDE = 0x6F # Virtual key code of Numeric KeyPad / key
|
|
82
|
+
KEY_F1 = 0x70 # Virtual key code of F1 key
|
|
83
|
+
KEY_F2 = 0x71 # Virtual key code of F2 key
|
|
84
|
+
KEY_F3 = 0x72 # Virtual key code of F3 key
|
|
85
|
+
KEY_F4 = 0x73 # Virtual key code of F4 key
|
|
86
|
+
KEY_F5 = 0x74 # Virtual key code of F5 key
|
|
87
|
+
KEY_F6 = 0x75 # Virtual key code of F6 key
|
|
88
|
+
KEY_F7 = 0x76 # Virtual key code of F7 key
|
|
89
|
+
KEY_F8 = 0x77 # Virtual key code of F8 key
|
|
90
|
+
KEY_F9 = 0x78 # Virtual key code of F9 key
|
|
91
|
+
KEY_F10 = 0x79 # Virtual key code of F10 key
|
|
92
|
+
KEY_F11 = 0x7A # Virtual key code of F11 key
|
|
93
|
+
KEY_F12 = 0x7B # Virtual key code of F12 key
|
|
94
|
+
KEY_NUM_LOCK = 0x90 # Virtual key code of Num Lock key
|
|
95
|
+
KEY_SCROLL_LOCK = 0x91 # Virtual key code of Scroll Lock key
|
|
96
|
+
KEY_SEMICOLON = 0xBA # Virtual key code of ; key
|
|
97
|
+
KEY_EQUALS = 0xBB # Virtual key code of = key
|
|
98
|
+
KEY_COMMA = 0xBC # Virtual key code of , key
|
|
99
|
+
KEY_HYPHEN = 0xBD # Virtual key code of - key
|
|
100
|
+
KEY_DOT = 0xBE # Virtual key code of . key
|
|
101
|
+
KEY_SLASH = 0xBF # Virtual key code of / key
|
|
102
|
+
KEY_OPEN_QUOTE = 0xC0 # Virtual key code of ` key
|
|
103
|
+
KEY_OPEN_BRACKET = 0xDB # Virtual key code of [ key
|
|
104
|
+
KEY_BACKSLASH = 0xDC # Virtual key code of \ key
|
|
105
|
+
KEY_CLOSE_BRACKET = 0xDD # Virtual key code of ] key
|
|
106
|
+
KEY_CLOSE_QUOTE = 0xDE # Virtual key code of ' key
|
|
107
|
+
VK_LBUTTON = 0x01 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
108
|
+
VK_RBUTTON = 0x02 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
109
|
+
VK_CANCEL = 0x03 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
110
|
+
VK_MBUTTON = 0x04 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
111
|
+
VK_XBUTTON1 = 0x05 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
112
|
+
VK_XBUTTON2 = 0x06 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
113
|
+
VK_BACK = 0x08 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
114
|
+
VK_TAB = 0x09 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
115
|
+
VK_CLEAR = 0x0C # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
116
|
+
VK_RETURN = 0x0D # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
117
|
+
VK_SHIFT = 0x10 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
118
|
+
VK_CONTROL = 0x11 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
119
|
+
VK_MENU = 0x12 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
120
|
+
VK_PAUSE = 0x13 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
121
|
+
VK_CAPITAL = 0x14 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
122
|
+
VK_KANA = 0x15 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
123
|
+
VK_HANGEUL = 0x15 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
124
|
+
VK_HANGUL = 0x15 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
125
|
+
VK_JUNJA = 0x17 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
126
|
+
VK_FINAL = 0x18 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
127
|
+
VK_HANJA = 0x19 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
128
|
+
VK_KANJI = 0x19 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
129
|
+
VK_ESCAPE = 0x1B # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
130
|
+
VK_CONVERT = 0x1C # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
131
|
+
VK_NONCONVERT = 0x1D # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
132
|
+
VK_ACCEPT = 0x1E # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
133
|
+
VK_MODECHANGE = 0x1F # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
134
|
+
VK_SPACE = 0x20 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
135
|
+
VK_PRIOR = 0x21 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
136
|
+
VK_NEXT = 0x22 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
137
|
+
VK_END = 0x23 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
138
|
+
VK_HOME = 0x24 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
139
|
+
VK_LEFT = 0x25 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
140
|
+
VK_UP = 0x26 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
141
|
+
VK_RIGHT = 0x27 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
142
|
+
VK_DOWN = 0x28 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
143
|
+
VK_SELECT = 0x29 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
144
|
+
VK_PRINT = 0x2A # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
145
|
+
VK_EXECUTE = 0x2B # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
146
|
+
VK_SNAPSHOT = 0x2C # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
147
|
+
VK_INSERT = 0x2D # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
148
|
+
VK_DELETE = 0x2E # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
149
|
+
VK_HELP = 0x2F # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
150
|
+
VK_LWIN = 0x5B # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
151
|
+
VK_RWIN = 0x5C # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
152
|
+
VK_APPS = 0x5D # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
153
|
+
VK_SLEEP = 0x5F # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
154
|
+
VK_NUMPAD0 = 0x60 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
155
|
+
VK_NUMPAD1 = 0x61 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
156
|
+
VK_NUMPAD2 = 0x62 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
157
|
+
VK_NUMPAD3 = 0x63 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
158
|
+
VK_NUMPAD4 = 0x64 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
159
|
+
VK_NUMPAD5 = 0x65 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
160
|
+
VK_NUMPAD6 = 0x66 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
161
|
+
VK_NUMPAD7 = 0x67 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
162
|
+
VK_NUMPAD8 = 0x68 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
163
|
+
VK_NUMPAD9 = 0x69 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
164
|
+
VK_MULTIPLY = 0x6A # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
165
|
+
VK_ADD = 0x6B # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
166
|
+
VK_SEPARATOR = 0x6C # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
167
|
+
VK_SUBTRACT = 0x6D # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
168
|
+
VK_DECIMAL = 0x6E # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
169
|
+
VK_DIVIDE = 0x6F # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
170
|
+
VK_F1 = 0x70 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
171
|
+
VK_F2 = 0x71 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
172
|
+
VK_F3 = 0x72 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
173
|
+
VK_F4 = 0x73 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
174
|
+
VK_F5 = 0x74 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
175
|
+
VK_F6 = 0x75 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
176
|
+
VK_F7 = 0x76 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
177
|
+
VK_F8 = 0x77 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
178
|
+
VK_F9 = 0x78 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
179
|
+
VK_F10 = 0x79 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
180
|
+
VK_F11 = 0x7A # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
181
|
+
VK_F12 = 0x7B # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
182
|
+
VK_F13 = 0x7C # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
183
|
+
VK_F14 = 0x7D # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
184
|
+
VK_F15 = 0x7E # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
185
|
+
VK_F16 = 0x7F # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
186
|
+
VK_F17 = 0x80 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
187
|
+
VK_F18 = 0x81 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
188
|
+
VK_F19 = 0x82 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
189
|
+
VK_F20 = 0x83 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
190
|
+
VK_F21 = 0x84 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
191
|
+
VK_F22 = 0x85 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
192
|
+
VK_F23 = 0x86 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
193
|
+
VK_F24 = 0x87 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
194
|
+
VK_NUMLOCK = 0x90 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
195
|
+
VK_SCROLL = 0x91 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
196
|
+
VK_OEM_NEC_EQUAL = 0x92 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
197
|
+
VK_OEM_FJ_JISHO = 0x92 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
198
|
+
VK_OEM_FJ_MASSHOU = 0x93 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
199
|
+
VK_OEM_FJ_TOUROKU = 0x94 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
200
|
+
VK_OEM_FJ_LOYA = 0x95 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
201
|
+
VK_OEM_FJ_ROYA = 0x96 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
202
|
+
VK_LSHIFT = 0xA0 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
203
|
+
VK_RSHIFT = 0xA1 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
204
|
+
VK_LCONTROL = 0xA2 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
205
|
+
VK_RCONTROL = 0xA3 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
206
|
+
VK_LMENU = 0xA4 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
207
|
+
VK_RMENU = 0xA5 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
208
|
+
VK_BROWSER_BACK = 0xA6 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
209
|
+
VK_BROWSER_FORWARD = 0xA7 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
210
|
+
VK_BROWSER_REFRESH = 0xA8 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
211
|
+
VK_BROWSER_STOP = 0xA9 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
212
|
+
VK_BROWSER_SEARCH = 0xAA # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
213
|
+
VK_BROWSER_FAVORITES = 0xAB # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
214
|
+
VK_BROWSER_HOME = 0xAC # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
215
|
+
VK_VOLUME_MUTE = 0xAD # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
216
|
+
VK_VOLUME_DOWN = 0xAE # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
217
|
+
VK_VOLUME_UP = 0xAF # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
218
|
+
VK_MEDIA_NEXT_TRACK = 0xB0 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
219
|
+
VK_MEDIA_PREV_TRACK = 0xB1 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
220
|
+
VK_MEDIA_STOP = 0xB2 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
221
|
+
VK_MEDIA_PLAY_PAUSE = 0xB3 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
222
|
+
VK_LAUNCH_MAIL = 0xB4 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
223
|
+
VK_LAUNCH_MEDIA_SELECT = 0xB5 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
224
|
+
VK_LAUNCH_APP1 = 0xB6 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
225
|
+
VK_LAUNCH_APP2 = 0xB7 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
226
|
+
VK_OEM_1 = 0xBA # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
227
|
+
VK_OEM_PLUS = 0xBB # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
228
|
+
VK_OEM_COMMA = 0xBC # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
229
|
+
VK_OEM_MINUS = 0xBD # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
230
|
+
VK_OEM_PERIOD = 0xBE # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
231
|
+
VK_OEM_2 = 0xBF # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
232
|
+
VK_OEM_3 = 0xC0 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
233
|
+
VK_OEM_4 = 0xDB # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
234
|
+
VK_OEM_5 = 0xDC # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
235
|
+
VK_OEM_6 = 0xDD # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
236
|
+
VK_OEM_7 = 0xDE # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
237
|
+
VK_OEM_8 = 0xDF # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
238
|
+
VK_OEM_AX = 0xE1 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
239
|
+
VK_OEM_102 = 0xE2 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
240
|
+
VK_ICO_HELP = 0xE3 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
241
|
+
VK_ICO_00 = 0xE4 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
242
|
+
VK_PROCESSKEY = 0xE5 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
243
|
+
VK_ICO_CLEAR = 0xE6 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
244
|
+
VK_PACKET = 0xE7 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
245
|
+
VK_OEM_RESET = 0xE9 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
246
|
+
VK_OEM_JUMP = 0xEA # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
247
|
+
VK_OEM_PA1 = 0xEB # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
248
|
+
VK_OEM_PA2 = 0xEC # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
249
|
+
VK_OEM_PA3 = 0xED # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
250
|
+
VK_OEM_WSCTRL = 0xEE # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
251
|
+
VK_OEM_CUSEL = 0xEF # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
252
|
+
VK_OEM_ATTN = 0xF0 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
253
|
+
VK_OEM_FINISH = 0xF1 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
254
|
+
VK_OEM_COPY = 0xF2 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
255
|
+
VK_OEM_AUTO = 0xF3 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
256
|
+
VK_OEM_ENLW = 0xF4 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
257
|
+
VK_OEM_BACKTAB = 0xF5 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
258
|
+
VK_ATTN = 0xF6 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
259
|
+
VK_CRSEL = 0xF7 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
260
|
+
VK_EXSEL = 0xF8 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
261
|
+
VK_EREOF = 0xF9 # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
262
|
+
VK_PLAY = 0xFA # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
263
|
+
VK_ZOOM = 0xFB # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
264
|
+
VK_NONAME = 0xFC # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
265
|
+
VK_PA1 = 0xFD # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
266
|
+
VK_OEM_CLEAR = 0xFE # @see https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731.aspx
|
|
267
|
+
|
|
268
|
+
end
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
require_relative('attributes_equal_checker')
|
|
2
|
+
|
|
3
|
+
# <code>Point</code> object represent a point on a two direction plane.
|
|
4
|
+
class SpecialInputDevice::Point
|
|
5
|
+
|
|
6
|
+
include(SpecialInputDevice::AttributesEqualChecker)
|
|
7
|
+
|
|
8
|
+
# @return [Integer] the x-coordinate of the point
|
|
9
|
+
attr_reader :x
|
|
10
|
+
# @param [Integer] value the x-coordinate of the point
|
|
11
|
+
def x=(value)
|
|
12
|
+
@x = value.to_i
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# @return [Integer] the y-coordinate of the point
|
|
16
|
+
attr_reader :y
|
|
17
|
+
# @param [Integer] value the y-coordinate of the point
|
|
18
|
+
def y=(value)
|
|
19
|
+
@y = value.to_i
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
# @!scope class
|
|
23
|
+
# @overload new(x, y)
|
|
24
|
+
# Returns a new instance of <code>Point</code>.
|
|
25
|
+
# @param [Integer] x the x-coordinate of the point
|
|
26
|
+
# @param [Integer] y the y-coordinate of the point
|
|
27
|
+
# @return [SpecialInputDevice::Point] a new instance of <code>Point</code>
|
|
28
|
+
def initialize(x, y)
|
|
29
|
+
self.x = x
|
|
30
|
+
self.y = y
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# @!visibility private
|
|
34
|
+
def inspect
|
|
35
|
+
"(#{x}, #{y})"
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# @!visibility private
|
|
39
|
+
def to_a
|
|
40
|
+
[x, y]
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# @!visibility private
|
|
44
|
+
def to_s
|
|
45
|
+
"(#{x}, #{y})"
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
end
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
require_relative('attributes_equal_checker')
|
|
2
|
+
|
|
3
|
+
# <code>Rectangle</code> object represent a rectangle plane on a two direction plane.
|
|
4
|
+
class SpecialInputDevice::Rectangle
|
|
5
|
+
|
|
6
|
+
include(SpecialInputDevice::AttributesEqualChecker)
|
|
7
|
+
|
|
8
|
+
# @return [Integer] the height of the rectangle
|
|
9
|
+
attr_reader :height
|
|
10
|
+
# @param [Integer] value the height of the rectangle
|
|
11
|
+
def height=(value)
|
|
12
|
+
@height = value.to_i
|
|
13
|
+
if @height < 0
|
|
14
|
+
@origin = SpecialInputDevice::Point.new(@origin.x, @origin.y + @height)
|
|
15
|
+
@height = -@height
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
# @return [Integer] the width of the rectangle
|
|
20
|
+
attr_reader :width
|
|
21
|
+
# @param [Integer] value the width of the rectangle
|
|
22
|
+
def width=(value)
|
|
23
|
+
@width = value.to_i
|
|
24
|
+
if @width < 0
|
|
25
|
+
@origin = SpecialInputDevice::Point.new(@origin.x + @width, @origin.y)
|
|
26
|
+
@width = -@width
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# @!attribute bottom
|
|
31
|
+
# @return [Integer] the y-coordinate of the bottom edge
|
|
32
|
+
def bottom
|
|
33
|
+
@origin.y + @height
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# @param [Integer] value the y-coordinate of the bottom edge
|
|
37
|
+
def bottom=(value)
|
|
38
|
+
value = value.to_i
|
|
39
|
+
top = self.top
|
|
40
|
+
@origin = SpecialInputDevice::Point.new(@origin.y, [top, value].min)
|
|
41
|
+
@height = (value - top).abs
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# @!attribute left
|
|
45
|
+
# @return [Integer] the x-coordinate of the left edge
|
|
46
|
+
def left
|
|
47
|
+
@origin.x
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# @param [Integer] value the x-coordinate of the left edge
|
|
51
|
+
def left=(value)
|
|
52
|
+
value = value.to_i
|
|
53
|
+
right = self.right
|
|
54
|
+
@origin = SpecialInputDevice::Point.new([value, right].min, @origin.y)
|
|
55
|
+
@width = (right - value).abs
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
alias_method(:x, :left)
|
|
59
|
+
alias_method(:x=, :left=)
|
|
60
|
+
|
|
61
|
+
# @!attribute right
|
|
62
|
+
# @return [Integer] the x-coordinate of the right edge
|
|
63
|
+
def right
|
|
64
|
+
@origin.x + @width
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# @param [Integer] value the x-coordinate of the right edge
|
|
68
|
+
def right=(value)
|
|
69
|
+
value = value.to_i
|
|
70
|
+
left = self.left
|
|
71
|
+
@origin = SpecialInputDevice::Point.new([left, value].min, @origin.y)
|
|
72
|
+
@width = (value - left).abs
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# @!attribute top
|
|
76
|
+
# @return [Integer] the y-coordinate of the top edge
|
|
77
|
+
def top
|
|
78
|
+
@origin.y
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# @param [Integer] value the y-coordinate of the top edge
|
|
82
|
+
def top=(value)
|
|
83
|
+
value = value.to_i
|
|
84
|
+
bottom = self.bottom
|
|
85
|
+
@origin = SpecialInputDevice::Point.new(@origin.x, [value, bottom].min)
|
|
86
|
+
@height = (bottom - value).abs
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
alias_method(:y, :top)
|
|
90
|
+
alias_method(:y=, :top=)
|
|
91
|
+
|
|
92
|
+
# @!scope class
|
|
93
|
+
# @!method new(*arguments)
|
|
94
|
+
# @overload new(top_left, bottom_right)
|
|
95
|
+
# @param [SpecialInputDevice::Point] top_left the point at top left
|
|
96
|
+
# @param [SpecialInputDevice::Point] bottom_right the point at bottom right
|
|
97
|
+
# @overload new(top_left, width, height)
|
|
98
|
+
# @param [SpecialInputDevice::Point] top_left the top left point
|
|
99
|
+
# @param [Integer] width the width of rectangle
|
|
100
|
+
# @param [Integer] height the height of rectangle
|
|
101
|
+
# @overload new(x, y, width, height)
|
|
102
|
+
# @param [Integer] x the x-coordinate of the left edge
|
|
103
|
+
# @param [Integer] y the y-coordinate of the top edge
|
|
104
|
+
# @param [Integer] width the width of rectangle
|
|
105
|
+
# @param [Integer] height the height of rectangle
|
|
106
|
+
|
|
107
|
+
# @!visibility private
|
|
108
|
+
def initialize(*arguments)
|
|
109
|
+
case count = arguments.size
|
|
110
|
+
when 2
|
|
111
|
+
@origin = arguments[0]
|
|
112
|
+
raise(TypeError, "Expecting SpecialInputDevice::Point, #{@origin.class} gavin") unless @origin.is_a? SpecialInputDevice::Point
|
|
113
|
+
end_point = arguments[1]
|
|
114
|
+
raise(TypeError, "Expecting SpecialInputDevice::Point, #{end_point.class} gavin") unless end_point.is_a? SpecialInputDevice::Point
|
|
115
|
+
self.width = end_point.x - @origin.x
|
|
116
|
+
self.height = end_point.y - @origin.y
|
|
117
|
+
when 3
|
|
118
|
+
@origin = arguments[0]
|
|
119
|
+
raise(TypeError, "Expecting SpecialInputDevice::Point, #{@origin.class} gavin") unless @origin.is_a? SpecialInputDevice::Point
|
|
120
|
+
self.width = arguments[1]
|
|
121
|
+
self.height = arguments[2]
|
|
122
|
+
when 4
|
|
123
|
+
@origin = SpecialInputDevice::Point.new(arguments[0], arguments[1])
|
|
124
|
+
self.width = arguments[2]
|
|
125
|
+
self.height = arguments[3]
|
|
126
|
+
else
|
|
127
|
+
raise(ArgumentError, "wrong number of arguments (#{count} for 2..4)")
|
|
128
|
+
end
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# Moves the rectangle relatively without changing the size.
|
|
132
|
+
# @param [Integer] x the relative change of x
|
|
133
|
+
# @param [Integer] y the relative change of y
|
|
134
|
+
# @return [SpecialInputDevice::Rectangle] new rectangle
|
|
135
|
+
def move(x, y)
|
|
136
|
+
result = dup
|
|
137
|
+
result.move!(x, y)
|
|
138
|
+
result
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Moves the rectangle relatively without changing the size.
|
|
142
|
+
# @param [Integer] x the relative change of x
|
|
143
|
+
# @param [Integer] y the relative change of y
|
|
144
|
+
# @return [SpecialInputDevice::Point] the point of top left corner
|
|
145
|
+
def move!(x, y)
|
|
146
|
+
@origin = SpecialInputDevice::Point.new(@origin.x + x, @origin.y + y)
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# Moves the rectangle absolutely without changing the size.
|
|
150
|
+
# @param [Integer] x new x-coordinate
|
|
151
|
+
# @param [Integer] y new y-coordinate
|
|
152
|
+
# @return [SpecialInputDevice::Rectangle] new rectangle
|
|
153
|
+
def move_to(x, y)
|
|
154
|
+
result = dup
|
|
155
|
+
result.move_to!(x, y)
|
|
156
|
+
result
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
# Moves the rectangle absolutely without changing the size.
|
|
160
|
+
# @param [Integer] x new x-coordinate
|
|
161
|
+
# @param [Integer] y new y-coordinate
|
|
162
|
+
# @return [SpecialInputDevice::Point] the point of top left corner
|
|
163
|
+
def move_to!(x, y)
|
|
164
|
+
@origin = SpecialInputDevice::Point.new(x, y)
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
# @return [Array(Integer, Integer)] width and height in an array
|
|
168
|
+
def size
|
|
169
|
+
[width, height]
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
# @!visibility private
|
|
173
|
+
def inspect
|
|
174
|
+
"<upper-left: #{@origin.inspect}, bottom-right: #{SpecialInputDevice::Point.new(right, bottom).inspect}, width: #{width}, height: #{height}>"
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
# @!visibility private
|
|
178
|
+
def to_a
|
|
179
|
+
@origin.to_a << width << height
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
# @!visibility private
|
|
183
|
+
def to_s
|
|
184
|
+
"<#{left}, #{top}, #{width}, #{height}>"
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
end
|