|
@@ -479,6 +479,7 @@ const
|
|
var MouseEvent: TMouseEvent;
|
|
var MouseEvent: TMouseEvent;
|
|
ch : char;
|
|
ch : char;
|
|
fdsin : tfdSet;
|
|
fdsin : tfdSet;
|
|
|
|
+ buttonval:byte;
|
|
begin
|
|
begin
|
|
fpFD_ZERO(fdsin);
|
|
fpFD_ZERO(fdsin);
|
|
fpFD_SET(StdInputHandle,fdsin);
|
|
fpFD_SET(StdInputHandle,fdsin);
|
|
@@ -488,15 +489,21 @@ const
|
|
fpSelect(StdInputHandle+1,@fdsin,nil,nil,10);
|
|
fpSelect(StdInputHandle+1,@fdsin,nil,nil,10);
|
|
ch:=ttyRecvChar;
|
|
ch:=ttyRecvChar;
|
|
{ Other bits are used for Shift, Meta and Ctrl modifiers PM }
|
|
{ Other bits are used for Shift, Meta and Ctrl modifiers PM }
|
|
- case (ord(ch)-ord(' ')) and 3 of
|
|
|
|
|
|
+ buttonval:=byte(ch)-byte(' ');
|
|
|
|
+ {bits 0..1: button status
|
|
|
|
+ bit 5 : mouse movement while button down.
|
|
|
|
+ bit 6 : interpret button 1 as button 4
|
|
|
|
+ interpret button 2 as button 5}
|
|
|
|
+ case buttonval and 3 of
|
|
0 : {left button press}
|
|
0 : {left button press}
|
|
MouseEvent.buttons:=1;
|
|
MouseEvent.buttons:=1;
|
|
1 : {middle button pressed }
|
|
1 : {middle button pressed }
|
|
MouseEvent.buttons:=2;
|
|
MouseEvent.buttons:=2;
|
|
2 : { right button pressed }
|
|
2 : { right button pressed }
|
|
MouseEvent.buttons:=4;
|
|
MouseEvent.buttons:=4;
|
|
- 3 : { no button pressed };
|
|
|
|
- end;
|
|
|
|
|
|
+ 3 : { no button pressed }
|
|
|
|
+ MouseEvent.buttons:=0;
|
|
|
|
+ end;
|
|
if inhead=intail then
|
|
if inhead=intail then
|
|
fpSelect(StdInputHandle+1,@fdsin,nil,nil,10);
|
|
fpSelect(StdInputHandle+1,@fdsin,nil,nil,10);
|
|
ch:=ttyRecvChar;
|
|
ch:=ttyRecvChar;
|
|
@@ -505,9 +512,14 @@ const
|
|
fpSelect(StdInputHandle+1,@fdsin,nil,nil,10);
|
|
fpSelect(StdInputHandle+1,@fdsin,nil,nil,10);
|
|
ch:=ttyRecvChar;
|
|
ch:=ttyRecvChar;
|
|
MouseEvent.y:=Ord(ch)-ord(' ')-1;
|
|
MouseEvent.y:=Ord(ch)-ord(' ')-1;
|
|
- if (MouseEvent.buttons<>0) then
|
|
|
|
- MouseEvent.action:=MouseActionDown
|
|
|
|
|
|
+ mouseevent.action:=MouseActionMove;
|
|
|
|
+ if (lastmouseevent.buttons=0) and (mouseevent.buttons<>0) then
|
|
|
|
+ MouseEvent.action:=MouseActionDown;
|
|
|
|
+ if (lastmouseevent.buttons<>0) and (mouseevent.buttons=0) then
|
|
|
|
+ MouseEvent.action:=MouseActionUp;
|
|
|
|
+(*
|
|
else
|
|
else
|
|
|
|
+
|
|
begin
|
|
begin
|
|
if (LastMouseEvent.Buttons<>0) and
|
|
if (LastMouseEvent.Buttons<>0) and
|
|
((LastMouseEvent.X<>MouseEvent.X) or (LastMouseEvent.Y<>MouseEvent.Y)) then
|
|
((LastMouseEvent.X<>MouseEvent.X) or (LastMouseEvent.Y<>MouseEvent.Y)) then
|
|
@@ -522,6 +534,7 @@ const
|
|
end;
|
|
end;
|
|
MouseEvent.Action:=MouseActionUp;
|
|
MouseEvent.Action:=MouseActionUp;
|
|
end;
|
|
end;
|
|
|
|
+*)
|
|
PutMouseEvent(MouseEvent);
|
|
PutMouseEvent(MouseEvent);
|
|
{$ifdef DebugMouse}
|
|
{$ifdef DebugMouse}
|
|
if MouseEvent.Action=MouseActionDown then
|
|
if MouseEvent.Action=MouseActionDown then
|