Subversion Repositories Kolibri OS

Rev

Rev 602 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
602 Rus 1
; Detecting mouse right-clicks.
2
 
3
detect_start:
4
 
5
	mov	eax, 40
6
	mov	ebx, 00100000b
7
	int	0x40
8
 
9
   detect_still:
633 diamond 10
	;mov     eax, 10        ; Работает не совсем корректно, почему хз.
602 Rus 11
	mov	eax, 23
12
	mov	ebx, 4
13
	int	0x40
14
	;cmp     eax, 6
15
	;jne     detect_still
16
 
17
	mov	eax, 37
633 diamond 18
	mov	ebx, 2		; Опрашиваем кнопки мыши
602 Rus 19
	int	0x40
20
 
633 diamond 21
	test	eax, ebx	; test    eax, 00000010b Интересует только правая кнопка
22
	jz	detect_still	; Нет - ? Возвращаемся в главный цикл потока
602 Rus 23
 
24
   mouse_btn_up:
25
	mov	eax, 37
26
	mov	ebx, 2
27
	int	0x40
28
 
29
	test	eax, ebx
30
	jnz	mouse_btn_up
31
 
32
	mov	eax, 37
33
	xor	ebx, ebx	; mov     ebx, 0
34
	int	0x40
35
 
36
	mov	ecx, [panel_y_pos]
37
	shr	ecx, 16
38
	inc	ecx
39
 
40
	cmp	ax, cx
41
	jb	detect_still
42
	add	ecx, 15
43
	cmp	ax, cx
44
	ja	detect_still
45
 
46
	shr	eax, 16
47
	xor	edx, edx	; mov     edx, 1
48
	inc	edx
49
 
50
   detect_button:
51
	mov	ebx, edx
52
	imul	ebx, 6 * 10
633 diamond 53
; // Alver  26.08.2007 // {
54
;	add	ebx, 4
55
	add	ebx, 64
56
; } \\ Alver \\
602 Rus 57
 
58
	cmp	eax, ebx
59
	jb	detect_still
60
 
61
	add	ebx, 60 - 1
62
	cmp	eax, ebx
63
	ja	@f
64
 
65
	shl	edx, 2
66
	mov	ecx, [app_list + edx - 4]
67
	cmp	ecx, -1
68
	jz	detect_still
69
 
70
	mov	[x_coord], ax
71
 
72
	mov	eax, 37
73
	xor	ebx, ebx	; mov     ebx, 0
74
	int	0x40
75
 
76
	mov	[y_coord], ax
77
 
78
	mov	[n_slot], ecx
79
 
633 diamond 80
	mov	eax, 9
81
	mov	ebx, procinfo_for_detect
82
	int	0x40
83
 
602 Rus 84
	mov	eax, 51
85
	mov	ebx, 1
86
	mov	ecx, context_menu_start
87
	mov	edx, ctx_menu_stack
88
	int	0x40
89
 
90
	mov	[ctx_menu_PID], eax
91
 
92
	jmp	detect_still
93
 
94
   @@:
95
	cmp	edx, [max_applications]
96
	jae	detect_still
97
	inc	edx
98
	jmp	detect_button