Subversion Repositories Kolibri OS

Rev

Rev 5676 | Rev 6887 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5676 Rev 5996
Line 20... Line 20...
20
 *  tmp - time keycode 
20
 *  tmp - time keycode 
21
 *  down - key event press
21
 *  down - key event press
22
 *  up - key release events
22
 *  up - key release events
23
 *  move - event MOUSE movements
23
 *  move - event MOUSE movements
24
 *  click - when clicked
24
 *  click - when clicked
25
 *  dblclick - double-click the default 50 (500 ms)
25
 *  dblclick - double-click get system value
26
 *  drag - drag the element event
26
 *  drag - drag the element event
27
 */
27
 */
Line 28... Line 28...
28
 
28
 
29
:dword __TMP_TIME,MOUSE_TIME;
29
:dword __TMP_TIME,DOUBLE_CLICK_DELAY;
30
:struct MOUSE
30
:struct MOUSE
31
{
31
{
32
	signed x,y,xx,yy,lkm,mkm,pkm,key,tmp,tmp_time,hor,vert,down,up,move,click,dblclick,drag,left,top;
32
	signed x,y,xx,yy,lkm,mkm,pkm,key,tmp,tmp_time,hor,vert,down,up,move,click,dblclick,drag,left,top;
33
	dword handle,_;
33
	dword handle,_;
Line 40... Line 40...
40
	void slider();
40
	void slider();
41
	void show();
41
	void show();
42
} mouse;
42
} mouse;
43
:void MOUSE::clearTime()
43
:void MOUSE::clearTime()
44
{
44
{
45
	tmp_time = GetStartTime()+MOUSE_TIME;
45
	tmp_time = GetStartTime()+DOUBLE_CLICK_DELAY;
46
}
46
}
47
:void MOUSE::show()
47
:void MOUSE::show()
48
{
48
{
49
	if(!handle)return;
49
	if(!handle)return;
50
	ECX = handle;
50
	ECX = handle;
Line 147... Line 147...
147
		up   = true;
147
		up   = true;
148
		down = false;
148
		down = false;
149
		drag = false;
149
		drag = false;
150
		if(!move) click = true;
150
		if(!move) click = true;
151
		__TMP_TIME = GetStartTime();
151
		__TMP_TIME = GetStartTime();
152
		if(__TMP_TIME-tmp_time<=MOUSE_TIME)
152
		if(__TMP_TIME-tmp_time<=DOUBLE_CLICK_DELAY)
153
		{ 
153
		{ 
154
			dblclick = true;
154
			dblclick = true;
155
			click    = false; 
155
			click    = false; 
156
		}
156
		}
157
		tmp_time = __TMP_TIME;
157
		tmp_time = __TMP_TIME;
Line 210... Line 210...
210
	get();
210
	get();
211
	_x = x;_y = y;
211
	_x = x;_y = y;
212
	pause(5);
212
	pause(5);
213
}
213
}
Line -... Line 214...
-
 
214
 
-
 
215
 
-
 
216
/*=====================================================================================
-
 
217
===========================                                 ===========================
-
 
218
===========================              SYSTEM             ===========================
-
 
219
===========================                                 ===========================
-
 
220
=====================================================================================*/
-
 
221
 
-
 
222
 
-
 
223
inline fastcall int GetMouseSpeed() {
-
 
224
	$mov eax,18
-
 
225
	$mov ebx,19
-
 
226
	$mov ecx,0
-
 
227
	$int 0x40
-
 
228
}
-
 
229
 
-
 
230
inline fastcall void SetMouseSpeed(EDX) {
-
 
231
	$mov eax,18
-
 
232
	$mov ebx,19
-
 
233
	$mov ecx,1
-
 
234
	$int 0x40
-
 
235
}
-
 
236
 
-
 
237
inline fastcall int GetMouseAcceleration() {
-
 
238
	$mov eax,18
-
 
239
	$mov ebx,19
-
 
240
	$mov ecx,2
-
 
241
	$int 0x40
-
 
242
}
-
 
243
 
-
 
244
inline fastcall void SetMouseAcceleration(EDX) {
-
 
245
	$mov eax,18
-
 
246
	$mov ebx,19
-
 
247
	$mov ecx,3
-
 
248
	$int 0x40
-
 
249
}
-
 
250
 
-
 
251
inline fastcall int GetMouseDoubleClickDelay() {
-
 
252
	$mov eax,18
-
 
253
	$mov ebx,19
-
 
254
	$mov ecx,6
-
 
255
	$int 0x40
-
 
256
}
-
 
257
 
-
 
258
inline fastcall void SetMouseDoubleClickDelay(DL) {
-
 
259
	$mov eax,18
-
 
260
	$mov ebx,19
-
 
261
	$mov ecx,7
-
 
262
	$int 0x40
-
 
263
}
214
 
264
 
215
#endif
265
#endif