Click here to Skip to main content
15,115,503 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: WM_MOUSEWHEEL message and the Touchpad Pin
Richard MacCutchan13-Jun-19 22:19
mveRichard MacCutchan13-Jun-19 22:19 
GeneralRe: WM_MOUSEWHEEL message and the Touchpad Pin
Richard MacCutchan14-Jun-19 2:04
mveRichard MacCutchan14-Jun-19 2:04 
GeneralRe: WM_MOUSEWHEEL message and the Touchpad Pin
Gerry Schmitz15-Jun-19 6:36
mveGerry Schmitz15-Jun-19 6:36 
GeneralRe: WM_MOUSEWHEEL message and the Touchpad Pin
Richard MacCutchan15-Jun-19 7:58
mveRichard MacCutchan15-Jun-19 7:58 
QuestionRe: WM_MOUSEWHEEL message and the Touchpad Pin
David Crow13-Jun-19 11:45
MemberDavid Crow13-Jun-19 11:45 
AnswerRe: WM_MOUSEWHEEL message and the Touchpad Pin
Richard MacCutchan13-Jun-19 22:20
mveRichard MacCutchan13-Jun-19 22:20 
AnswerRe: WM_MOUSEWHEEL message and the Touchpad Pin
Richard MacCutchan14-Jun-19 2:03
mveRichard MacCutchan14-Jun-19 2:03 
AnswerRe: WM_MOUSEWHEEL message and the Touchpad Pin
Randor 14-Jun-19 1:31
professional Randor 14-Jun-19 1:31 
Hi,

Richard MacCutchan wrote:
I divide the zDelta value by 120 (WHEEL_DELTA) to calculate the (approximate) number of lines to scroll.

While it is true that the many of the old mouse drivers sent WHEEL_DELTA in multiples of 120 that is not always the case for high-precision mice and touchpads.

You are probably getting values much smaller than 120. To fix your code you need to keep track of the delta modulo of +/- 120 in a static local or class variable and add/subtract the latest delta from the previous value.

I also observe that you are hard-coding the line count rather than retrieving the user preference via SystemParametersInfo with SPI_GETWHEELSCROLLLINES.

Best Wishes,
-David Delaune
GeneralRe: WM_MOUSEWHEEL message and the Touchpad Pin
Richard MacCutchan14-Jun-19 1:55
mveRichard MacCutchan14-Jun-19 1:55 
PraiseRe: WM_MOUSEWHEEL message and the Touchpad Pin
Randor 14-Jun-19 3:00
professional Randor 14-Jun-19 3:00 
GeneralRe: WM_MOUSEWHEEL message and the Touchpad Pin
Richard MacCutchan14-Jun-19 4:07
mveRichard MacCutchan14-Jun-19 4:07 
QuestionC++ Callback process is dea Pin
Member 1422104113-Jun-19 0:05
MemberMember 1422104113-Jun-19 0:05 
AnswerRe: C++ Callback process is dea Pin
Victor Nijegorodov13-Jun-19 0:18
MemberVictor Nijegorodov13-Jun-19 0:18 
GeneralRe: C++ Callback process is dea Pin
Member 1422104113-Jun-19 0:48
MemberMember 1422104113-Jun-19 0:48 
SuggestionRe: C++ Callback process is dea Pin
David Crow13-Jun-19 8:45
MemberDavid Crow13-Jun-19 8:45 
GeneralRe: C++ Callback process is dea Pin
Victor Nijegorodov13-Jun-19 11:24
MemberVictor Nijegorodov13-Jun-19 11:24 
QuestionProblem using strings Pin
Rodrigo Lourenço7-Jun-19 12:01
MemberRodrigo Lourenço7-Jun-19 12:01 
AnswerRe: Problem using strings Pin
Victor Nijegorodov7-Jun-19 12:26
MemberVictor Nijegorodov7-Jun-19 12:26 
GeneralRe: Problem using strings Pin
Rodrigo Lourenço8-Jun-19 0:55
MemberRodrigo Lourenço8-Jun-19 0:55 
AnswerRe: Problem using strings Pin
k50547-Jun-19 12:39
mvek50547-Jun-19 12:39 
GeneralRe: Problem using strings Pin
Rodrigo Lourenço8-Jun-19 1:03
MemberRodrigo Lourenço8-Jun-19 1:03 
SuggestionRe: Problem using strings Pin
David Crow7-Jun-19 17:50
MemberDavid Crow7-Jun-19 17:50 
GeneralRe: Problem using strings Pin
Rodrigo Lourenço8-Jun-19 1:02
MemberRodrigo Lourenço8-Jun-19 1:02 
AnswerRe: Problem using strings Pin
Joe Woodbury7-Jun-19 19:47
professionalJoe Woodbury7-Jun-19 19:47 
GeneralRe: Problem using strings Pin
Rodrigo Lourenço8-Jun-19 0:59
MemberRodrigo Lourenço8-Jun-19 0:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.