Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Mouse Scroll Wheel Acceleration
#1
Question 
Hi!
In a previous post, I asked about setting up volume controls for a second mouse. I got that all running, but now I have one more question:

Is there a way to add acceleration to the scroll wheel? The wheel scrolls very slow, with very distinct notches. It takes forever to scroll.

Thanks!
#2
Wheel event frequency cannot be accelerated, but your macro can do what it does at bigger steps. If need to measure time from previous run, use a global int variable and function timeGetTime, it returns milliseconds since Windows started.
#3
Oh, ok. Thanks, Gintaras. I'll probably end up setting Ctrl + Scroll to have bigger steps, so it can still be precise.

What do you mean "measure time from a previous run"?

And, is it possible to have bigger steps when pressing down the middle button and scrolling?
#4
Quote:What do you mean "measure time from a previous run"?

If you want to make bigger steps when the time interval between wheel ticks is smaller, you can measure this interval. Get time with function timeGetTime and subtract previous time.

Quote:And, is it possible to have bigger steps when pressing down the middle button and scrolling?


Code:
Copy      Help
if RealGetKeyState(VK_MBUTTON)
,out "do 10 steps"
else
,out "do 1 step"
#5
Ugh, I have no clue how I would code the timeGetTime function...

Can you write out the code for me? I'm so new to all of this. I can't write it myself, but I understand it when other people write it.

Thanks!
#6
To test this macro, run it several times in second.
Macro Macro16
Code:
Copy      Help
int+ g_time445877
int t=timeGetTime
int diff=t-g_time445877+1; g_time445877=t
int steps=1000/diff+1
out F"diff={diff}, steps={steps}"
#7
Wait, so then how do I add in the volume up to that? I'm so confused. Thanks for working through this with me. I appreciate it so much.
#8
key (VK_VOLUME_UP)(#steps)

or

rep(steps) key (VK_VOLUME_UP)
#9
Where does that fit in? I'm so lost... would the trigger still be wheel up? Tell me if this sounds right...

1. Create macro
2. Set trigger to wheel up
3. Paste in this code
Code:
Copy      Help
int+ g_time445877
int t=timeGetTime
int diff=t-g_time445877+1; g_time445877=t
int steps=1000/diff+1
out F"diff={diff}, steps={steps}"
key (VK_VOLUME_UP)(#steps)
#10
Yes.
Also:
Adjust sensitivity. Probably 1000 is too much.
Set key autodelay = 0.
Optionally: In macro properties select "run simultaneously" or convert to function.
Move common code to a function.

Function AudioVolumeUpDown
Code:
Copy      Help
;/
function up

int+ g_time445877
int t=timeGetTime
int diff=t-g_time445877+1; g_time445877=t
int steps=100/diff+1
;out F"diff={diff}, steps={steps}"
spe 0
int vk=iif(up VK_VOLUME_UP VK_VOLUME_DOWN)
key (vk)(#steps)

Macro mouse wheel volume up
Trigger #U     Help - how to add the trigger to the macro
Code:
Copy      Help
AudioVolumeUpDown 1

Macro mouse wheel volume down
Trigger #D     Help - how to add the trigger to the macro
Code:
Copy      Help
AudioVolumeUpDown 0

And finally add the filter function to the trigger, if want it to work with a single mouse device.
http://www.quickmacros.com/forum/showthread.php?tid=627
#11
Oh!!! It all makes sense now! 100 sensitivity was definitely too low, and 1000 was too high. I see how it works now. That's genius. Ended up with 500.

Last question. For adding the filter function to function AudioVolumeUpDown, what do I set the trigger to?

Here's what I have so far, if this helps.
EDIT: Inserted it as an image here, but was super small. It's attached now.


Attached Files Image(s)
   
#12
Don't add trigger to AudioVolumeUpDown. Add to these 2 macros that have wheel triggers. I see in the image, already added.
#13
Oh, I know what's going on... the macros weren't triggering, so I thought I needed to add some trigger in. Turns out, my mouse is just malfunctioning on that PC. Only that PC, works fine on everything else. Has to be something to do with QuickMacros, but I'm not going to worry about it. That's just my test PC, belongs to a friend. Setting everything up on my PC.

Very last question, what language are the macros coded in? Hopefully I can learn a little, instead of asking for help every time I need something.
#14
Quick Macros scripting language. All reference is in Quick Macros help file. Don't learn too much because this language will be replaced with C# in next major version.
#15
Ok, having some issues again. Just a weird little bug I think, but maybe you have some idea of what happening.


If I execute a (volume related) macro using FF_Mouse2 as the trigger, the normal Windows popup appears showing what song is playing, the volume, and options to play/pause, skip track, or go to the previous track. But, while the popup is showing, an action on FF_Mouse1 will run a FF_Mouse2 specific macro.

Example: Left click on FF_Mouse2 is play/pause. I'll left click, and the popup appears. Then, if I were to left click with FF_Mouse1, it'll run the play/pause macro.

Trying a different mouse and swapping FF_Mouse1 and FF_Mouse2.

I think it's fixed... I had low level hooks disabled before, and it wasn't working. Then, I reinstalled Quick Macros and it still wasn't working. Forgot to disable low level hooks again, and now it just works. I think I was just overloading it before, I can't try to use both at the same time.

I guess I just need to pause for a second. Not ideal, but at least it works. I won't worry about it, unless you think it might be something fixable.

Never mind, it's still happening. Almost worse than before.
#16
It's some weird conflict with Keyboard Detector and my trackpad. My main external mouse isn't impacted. Maybe because I registered my trackpad as FF_Mouse1 at some point? Whatever, no worries. The media control mouse is meant to go with my desktop anyway.
#17
to get better help please show all your code your currently using
the last picture you posted was entirely to small and unreadable.


Tip
Q. How to post QM code to the forum?

A. In QM, to copy all or selected text, use menu Edit -> Other Formats -> Copy for QM Forum. It copies correct and colored code to the clipboard. Then simply paste in the forum. Don't use the Code button.


read here for more info
http://www.quickmacros.com/forum/showthread.php?tid=786

or you can put all relevant functions/macros in a folder  then right click on the folder and select export folder and save on your pc then upload as an attachment.
or you can try this
http://www.quickmacros.com/forum/showthr...7#pid12617
#18
Yeah, I should've just had all my code here to start. Sorry about that.

Only a couple more things to work out:
- In some full screen applications, the macro mouse will resume normal mouse function. Is there any way to fix that?

- When double right clicking, the track skips forward first, and then back. I need some code that waits to see if the right button is clicked twice before skipping forward. Been reading up on QM language for the past 2 hours, and I have no clue how to do this...
Basically something like this, in proper QM code:
if right button clicked
wait 0.5 sec to see if right button clicked a second time
if not skip song
if yes previous song


Attached Files
.qml   FF_Mouse1 Macros.qml (Size: 3 KB / Downloads: 273)
#19
Quote:In some full screen applications, the macro mouse will resume normal mouse function. Is there any way to fix that?

It is because in some windows don't work non-low-level hooks. But with low-level hooks does not work the keyboard/mouse detector (the FF_MouseX filter functions). Impossible to fix it.


Quote:When double right clicking...

Macro Macro14
Trigger #R     Help - how to add the trigger to the macro
Code:
Copy      Help
wait 0.5 MR; err int singleClick=1
out singleClick
#20
Quote:It is because in some windows don't work non-low-level hooks. But with low-level hooks does not work the keyboard/mouse detector (the FF_MouseX filter functions). Impossible to fix it.

Oh, ok. No worries.

Quote:wait 0.5 MR; err int singleClick=1
out singleClick

How do I add in the skip track into that? I've tried a few things, and haven't had any success. I also saw your previous message before you deleted it, and tried that for a while too, just out of curiosity.
#21
Macro Right Click - Skip Track
Trigger #R     Help - how to add the trigger to the macro
Code:
Copy      Help
wait 0.5 MR; err int singleClick=1
if singleClick = 1
,key (VK_MEDIA_NEXT_TRACK)
#22
Oh, duh! I should've been able to figure that out. Works perfectly, thanks so much both of you!


Forum Jump:


Users browsing this thread: 1 Guest(s)