Subversion Repositories Kolibri OS

Rev

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

Rev 5549 Rev 5572
Line 30... Line 30...
30
//Button options
30
//Button options
31
#define BT_DEL      0x80000000
31
#define BT_DEL      0x80000000
32
#define BT_HIDE     0x40000000
32
#define BT_HIDE     0x40000000
33
#define BT_NOFRAME  0x20000000
33
#define BT_NOFRAME  0x20000000
Line -... Line 34...
-
 
34
 
-
 
35
//Button mouse
-
 
36
#define MOUSE_LEFT 100b
-
 
37
#define MOUSE_RIGHT 001b
-
 
38
#define MOUSE_CENTER 010b
34
 
39
 
35
//ASCII KEYS
40
//ASCII KEYS
36
#define ASCII_KEY_BS    008
41
#define ASCII_KEY_BS    008
37
#define ASCII_KEY_TAB   009
42
#define ASCII_KEY_TAB   009
38
#define ASCII_KEY_ENTER 013
43
#define ASCII_KEY_ENTER 013
Line 55... Line 60...
55
 
60
 
56
:struct raw_image {
61
:struct raw_image {
57
	dword w, h, data;
62
	dword w, h, data;
Line -... Line 63...
-
 
63
};
-
 
64
 
-
 
65
/**
-
 
66
 *  The structure of the mouse
-
 
67
 *  x - coordinate X
-
 
68
 *  ó - coordinate Ó
-
 
69
 *  xx and yy - time coordinates
-
 
70
 *  lkm - left mouse button
-
 
71
 *  pkm - right mouse button
-
 
72
 *  mkm - mouse wheel
-
 
73
 *  key - keycode button
-
 
74
 *  tmp - time keycode 
-
 
75
 *  down - key event press
-
 
76
 *  up - key release events
58
};
77
 *  move - event mouse movements
59
 
78
 */
60
:struct mouse
79
:struct mouse
61
{
80
{
62
	signed x,y,lkm,mkm,pkm,hor,vert;
81
	signed x,y,xx,yy,lkm,mkm,pkm,key,tmp,hor,vert,down,up,move;
Line 63... Line 82...
63
	void get();
82
	void get();
64
};
83
};
Line 78... Line 97...
78
	EAX = 37;
97
	EAX = 37;
79
	EBX = 2;
98
	EBX = 2;
80
	$int	0x40
99
	$int	0x40
81
	$mov	ebx, eax
100
	$mov	ebx, eax
82
	$mov	ecx, eax
101
	$mov	ecx, eax
-
 
102
	key = EAX;
83
	$and	eax, 0x00000001
103
	$and	eax, 0x00000001
84
	$shr	ebx, 1
104
	$shr	ebx, 1
85
	$and	ebx, 0x00000001
105
	$and	ebx, 0x00000001
86
	$shr	ecx, 2
106
	$shr	ecx, 2
87
	$and	ecx, 0x00000001
107
	$and	ecx, 0x00000001
88
	lkm = EAX;
108
	lkm = EAX;
89
	pkm = EBX;
109
	pkm = EBX;
90
	mkm = ECX;
110
	mkm = ECX;
-
 
111
	
-
 
112
	//when you release the mouse button
-
 
113
	if((down)&&!(key)){
-
 
114
		up = true;
-
 
115
		down = false;
-
 
116
		
-
 
117
		//returns the key code
-
 
118
		key = tmp;
-
 
119
		lkm = 1&tmp;
-
 
120
		pkm = 2&tmp;
-
 
121
		pkm >>= 1;
-
 
122
		mkm = 4&tmp;
-
 
123
		mkm >>= 2;
-
 
124
	}
-
 
125
	
-
 
126
	//when you press the mouse button
-
 
127
	else {
-
 
128
		up = false;
-
 
129
		down = key;
-
 
130
		if(down)tmp=key;
-
 
131
		if((xx!=x)||(yy!=y)){
-
 
132
			move = true;
-
 
133
			xx = x;
-
 
134
			yy = y;
-
 
135
		}
-
 
136
		else move = false;
-
 
137
	}
-
 
138
	
91
	EAX = 37; //áªà®««
139
	EAX = 37; //áªà®««
92
	EBX = 7;
140
	EBX = 7;
93
	$int	0x40
141
	$int	0x40
94
	$mov	ebx, eax
142
	$mov	ebx, eax
95
	$shr	eax, 16
143
	$shr	eax, 16