Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  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:
  10.         ;mov     eax, 10        ; Ðàáîòàåò íå ñîâñåì êîððåêòíî, ïî÷åìó õç.
  11.         mov     eax, 23
  12.         mov     ebx, 4
  13.         int     0x40
  14.         ;cmp     eax, 6
  15.         ;jne     detect_still
  16.  
  17.         mov     eax, 37
  18.         mov     ebx, 2          ; Îïðàøèâàåì êíîïêè ìûøè
  19.         int     0x40
  20.  
  21.         test    eax, ebx        ; test    eax, 00000010b Èíòåðåñóåò òîëüêî ïðàâàÿ êíîïêà
  22.         jz      detect_still    ; Íåò - ? Âîçâðàùàåìñÿ â ãëàâíûé öèêë ïîòîêà
  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
  53.         add     ebx, 4
  54.  
  55.         cmp     eax, ebx
  56.         jb      detect_still
  57.  
  58.         add     ebx, 60 - 1
  59.         cmp     eax, ebx
  60.         ja      @f
  61.  
  62.         shl     edx, 2
  63.         mov     ecx, [app_list + edx - 4]
  64.         cmp     ecx, -1
  65.         jz      detect_still
  66.  
  67.         mov     [x_coord], ax
  68.  
  69.         mov     eax, 37
  70.         xor     ebx, ebx        ; mov     ebx, 0
  71.         int     0x40
  72.  
  73.         mov     [y_coord], ax
  74.  
  75.         mov     [n_slot], ecx
  76.  
  77.         mov     eax, 51
  78.         mov     ebx, 1
  79.         mov     ecx, context_menu_start
  80.         mov     edx, ctx_menu_stack
  81.         int     0x40
  82.  
  83.         mov     [ctx_menu_PID], eax
  84.  
  85.         jmp     detect_still
  86.  
  87.    @@:
  88.         cmp     edx, [max_applications]
  89.         jae     detect_still
  90.         inc     edx
  91.         jmp     detect_button
  92.  
  93.  
  94.  
  95.  
  96.  
  97.