summaryrefslogtreecommitdiff
path: root/src/corelib/x11/fpg_x11.pas
diff options
context:
space:
mode:
authorDavid Laurence Emerson <dle3ab@angelbase.com>2013-05-28 00:41:47 -0700
committerDavid Laurence Emerson <dle3ab@angelbase.com>2013-05-28 00:42:53 -0700
commit8f91e7081f8b3b64e2dab0d8dfb0e0c16c7558a0 (patch)
treea4f5c3c4ef15a47a3d3aba25f03b8980840e2161 /src/corelib/x11/fpg_x11.pas
parentb09c7b3129741b799aca08544f0f8eab5d675af7 (diff)
downloadfpGUI-8f91e7081f8b3b64e2dab0d8dfb0e0c16c7558a0.tar.xz
horizontal scrolling, commit 1
Diffstat (limited to 'src/corelib/x11/fpg_x11.pas')
-rw-r--r--src/corelib/x11/fpg_x11.pas47
1 files changed, 33 insertions, 14 deletions
diff --git a/src/corelib/x11/fpg_x11.pas b/src/corelib/x11/fpg_x11.pas
index 20974dfe..27f59abe 100644
--- a/src/corelib/x11/fpg_x11.pas
+++ b/src/corelib/x11/fpg_x11.pas
@@ -1749,31 +1749,50 @@ begin
if not blockmsg then
begin
if (ev.xbutton.button >= 4) and (ev.xbutton.button <= 7) then // mouse wheel
+ // 4=up, 5=down, 6=left, 7=right
begin
// generate scroll events:
if ev._type = X.ButtonPress then
begin
- if ev.xbutton.button = Button4 then
+ if (ev.xbutton.button = Button4) or (ev.xbutton.button = 6) then // x.pp lacks Button6, Button7
i := -1
else
i := 1;
// Check for other mouse wheel messages in the queue
- while XCheckTypedWindowEvent(display, ev.xbutton.window, X.ButtonPress, @NewEvent) do
- begin
- if NewEvent.xbutton.Button = 4 then
- Dec(i)
- else if NewEvent.xbutton.Button = 5 then
- Inc(i)
- else
- begin
- XPutBackEvent(display, @NewEvent);
- break;
- end;
- end;
+ if ev.xbutton.button in [Button4,Button5] then
+ while XCheckTypedWindowEvent(display, ev.xbutton.window, X.ButtonPress, @NewEvent) do
+ begin
+ if NewEvent.xbutton.Button = 4 then
+ Dec(i)
+ else if NewEvent.xbutton.Button = 5 then
+ Inc(i)
+ else
+ begin
+ XPutBackEvent(display, @NewEvent);
+ break;
+ end;
+ end
+ else // button is 6 or 7
+ while XCheckTypedWindowEvent(display, ev.xbutton.window, X.ButtonPress, @NewEvent) do
+ begin
+ if NewEvent.xbutton.Button = 6 then
+ Dec(i)
+ else if NewEvent.xbutton.Button = 7 then
+ Inc(i)
+ else
+ begin
+ XPutBackEvent(display, @NewEvent);
+ break;
+ end;
+ end;
msgp.mouse.delta := i;
- fpgPostMessage(nil, w, FPGM_SCROLL, msgp);
+
+ if ev.xbutton.button in [Button4,Button5] then
+ fpgPostMessage(nil, w, FPGM_SCROLL, msgp)
+ else
+ fpgPostMessage(nil, w, FPGM_HSCROLL, msgp);
end;
end
else