Recent

Author Topic: Shift-Mousewheel always negative WheelDelta  (Read 487 times)

ron.dunn

  • New Member
  • *
  • Posts: 32
Shift-Mousewheel always negative WheelDelta
« on: January 28, 2026, 03:07:34 am »
Consider the following code which I am running on Linux Mint.

When the SHIFT key is held down the value of WheelDelta is always negative.

When I uncomment the line to use the ALT key, WheelDelta is positive/negative depending on scroll direction.

Is this a SHIFT key error, or am I missing something about the semantics of SHIFT?

Code: Pascal  [Select][+][-]
  1. procedure TfMain.FormMouseWheel(Sender: TObject; Shift: TShiftState; WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
  2. var
  3.     adjustment: Integer = 1;
  4. begin
  5.  
  6.     fMain.Caption := WheelDelta.ToString;       // Debug WheelDelta
  7.  
  8.     //if ssAlt in Shift then adjustment := 10;
  9.     if ssShift in Shift then adjustment := 10;
  10.  
  11.     if WheelDelta > 0 then tickPixels := tickPixels + adjustment
  12.     else tickPixels := tickPixels - adjustment;
  13.  
  14.     if tickPixels > 20 then tickLabel5 := True else tickLabel5 := False;
  15.     if tickPixels > 50 then tickLabel1 := True else tickLabel1 := False;
  16.  
  17.     if tickPixels < 10 then tickPixels := 10
  18.     else if tickPixels > 10000 then tickPixels := 10000;
  19.  
  20.     formPaint (fMain);
  21.     Handled := True;
  22.  
  23.     end;
  24.  

jamie

  • Hero Member
  • *****
  • Posts: 7660
Re: Shift-Mousewheel always negative WheelDelta
« Reply #1 on: January 29, 2026, 12:06:47 am »
Widget code emulation of windows most likely not correct.

Or maybe your desktop (Widget) handles that case differently and that is what's happening, For example the difference between the Left Shift key and the Right shift key.

Jamie
The only true wisdom is knowing you know nothing

ron.dunn

  • New Member
  • *
  • Posts: 32
Re: Shift-Mousewheel always negative WheelDelta
« Reply #2 on: February 03, 2026, 07:11:25 am »
Circling back on this, it appears that the problem was caused by the Microsoft RDP software running on OSX.

When I run natively on my Linux desktop everything works fine.

 

TinyPortal © 2005-2018