FLTK logo

Re: [RFE] STR #3521: Allow shift+scroll for horizontal scrolling

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.bugs  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: [RFE] STR #3521: Allow shift+scroll for horizontal scrolling Albrecht Schlosser May 29, 2019  
 
DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR Pending]

Link: https://www.fltk.org/str.php?L3521
Version: 1.4-feature


FWIW, here's my take on this issue. According to MS docs the MK_SHIFT bit
is set if Shift is pressed during the event. I'm using this to invert the
wParam value of the WM_MOUSEHWHEEL event which is also executed in the
FALLTHROUGH case (WM_MOUSEWHEEL with Shift):

        // FALLTHROUGH
      case WM_MOUSEHWHEEL: {
	static int delta = 0; // running total of all motion
	// ** new code starts below
	int wparam = (SHORT)(HIWORD(wParam));
	if (LOWORD(wParam) & MK_SHIFT)
	  wparam = -wparam;
	delta += wparam;
	// ** new code ends above
	Fl::e_dy = 0;
	Fl::e_dx = delta / WHEEL_DELTA;
	delta -= Fl::e_dx * WHEEL_DELTA;
	if (Fl::e_dx)
	  Fl::handle(FL_MOUSEWHEEL, window);
	return 0;
      }

This patch, however, has the side effect that it would also invert the
scroll /direction/ of real horizontal mousewhee levents (WM_MOUSEHWHEEL).

It works, but I'm not entirely satisfied with this approach. Maybe we need
a longer but more explicit patch. Ideas?


Link: https://www.fltk.org/str.php?L3521
Version: 1.4-feature


Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.