Browse Source

GPM report two additional buttons.

Margers 1 month ago
parent
commit
0cad75f318
1 changed files with 7 additions and 3 deletions
  1. 7 3
      packages/rtl-console/src/unix/mouse.pp

+ 7 - 3
packages/rtl-console/src/unix/mouse.pp

@@ -85,11 +85,15 @@ begin
    MouseEvent.y:=0;
    MouseEvent.y:=0;
   MouseEvent.buttons:=0;
   MouseEvent.buttons:=0;
   if e.buttons and Gpm_b_left<>0 then
   if e.buttons and Gpm_b_left<>0 then
-   inc(MouseEvent.buttons,1);
+   inc(MouseEvent.buttons,MouseLeftButton);
   if e.buttons and Gpm_b_right<>0 then
   if e.buttons and Gpm_b_right<>0 then
-   inc(MouseEvent.buttons,2);
+   inc(MouseEvent.buttons,MouseRightButton);
   if e.buttons and Gpm_b_middle<>0 then
   if e.buttons and Gpm_b_middle<>0 then
-   inc(MouseEvent.buttons,4);
+   inc(MouseEvent.buttons,MouseMiddleButton);
+  if e.buttons and $08<>0 then
+   inc(MouseEvent.buttons,MouseXButton1);
+  if e.buttons and $10<>0 then
+   inc(MouseEvent.buttons,MouseXButton2);
   case (e.EventType and $f) of
   case (e.EventType and $f) of
     GPM_MOVE,
     GPM_MOVE,
     GPM_DRAG :
     GPM_DRAG :