AutoHotkey Community

It is currently May 27th, 2012, 4:02 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 177 posts ]  Go to page Previous  1 ... 6, 7, 8, 9, 10, 11, 12  Next
Author Message
 Post subject: Regarding how DtS works
PostPosted: April 8th, 2011, 11:57 pm 
Offline

Joined: April 1st, 2009, 8:32 pm
Posts: 71
Regarding how DtS works
DtS uses windows messaging (PostMessage) to sends the WM_MOUSEWHEEL (in its default mode--or WM_VSCROLL) messages to the target window, to request that the application scroll its window. PostMessage does not even return a response, so DtS does not even know if the window is scrolling!

It is largely up to each individual app to determine if and how to process those messages that it receives. The target app does not know where or how it got those messages, and there is no distinction between DtS sending them and windows sending them when the actual mousewheel is used. This is what gives DtS it's power and its wide compatibility, since all apps SHOULD handle these messages to support mousewheel use.

MouseImp, (and other alternatives in the forum here) on the other hand, appears to directly interact with an application's scrollbars, which gives them greater control over the scrolling behavior, but is less compatible with all applications. (I assume why 64bit apps don't work.) This is something I've looked at before as an optional feature, but its just not reliable enough to do anything with, for my taste.

Scrolling speed & Choppiness
Part of the WM_MOUSEWHEEL message allows me to request how much the app should scroll, but app support here is not great. I'm doing a bunch of math to scale this scroll amount according to the drag speed, and momentum speed. The smallest scroll amount DtS sends is about 10% of one mousewheel "click" (which is defined to be 120 units). However, apps can choose to ignore these tiny scroll amounts, or to catch them all and wait until they add up to 120, which appears to be common. Check out this for more on the topic: Why do people fail at handling WM_MOUSEWHEEL properly?

If you have a high-resolution mousewheel without the "click", you should see the same behavior by scrolling VERY slow with the mousewheel, the app will appear to ignore the scrolling, then jump one click when the 120 threshold is reached.

Scrollable windows within Scrollable windows
As drewwesley mentions, This is a behavior I have also noticed with some annoyance; where a scrollable sub-window comes into view, and intercepts the scrolling rather, than the parent window. This is also not something I can change, and you should see the exact same behavior by using the regular mousewheel. Different apps handle this differently, firefox seems to let sub-windows scroll, whereas chrome will only scroll sub-windows if it received the initial scroll.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 9th, 2011, 3:19 pm 
Please tell me. You can configure it so it does not work in browser Opera?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 11th, 2011, 5:58 pm 
Offline

Joined: April 1st, 2009, 8:32 pm
Posts: 71
I hope I am understanding you correctly; you're looking to disable the drag behavior for Opera only? I installed Opera, and I see now what I think you're looking for. Opera has a built in gesture menu, when you hold right button. There are two ways to get at this..

Movement Checking
UseMovementCheck is an option in DtS which requires that you click and move the mouse immediately for a drag to be started. If you simply click and hold the right button, without moving the mouse, the regular behavior will be send through to Opera, and bringing up Opera's gesture menu. The benefit of enabling this option is that it lets you use both drag scrolling, and other click-hold behavior on RButton, after a short delay.

1) Right click the DtS tray icon
2) Navigate to Settings > All Settings
3) Set UseMovementCheck to 1
4) Optionally adjust other config:
MovementCheckDelay - The delay before normal behavior in ms
MovementThreshold - Threshold of mouse movement before drag starts in px

Use AppSettings to disable DtS for a single app
The AppSettings dialog lets you configure DtS configuration properties on a per-app basis. The application which receives the initial click for dragging is captured, and it is compared to a list of saved settings. This allows you to set different behavior for different applications needs. Not all settings are configurable on a per-app basis, but many of the relevant ones are. To apply settings to an app, you may specify any of its: executable name, full path with executable name, the class of its window, or even the targeted control's class. Use autohotkey's Window Spy to get this information.

1) Right click the DtS tray icon
2) Navigate to Settings > App Settings
3) In the list at the top, type the app's identifying feature (in this case we'll use Opera's window class: OperaWindowClass)
4) Configure the app behavior, by selecting the Disabled checkbox.
5) Hit Apply, and Close


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 11th, 2011, 9:25 pm 
cheek
Yes. You have correctly understood me. Sorry for my English, I am Russian and I speak very little Englishю

Quote:
Use AppSettings to disable DtS for a single app

It's work!
I use now MouseImp ( which is designed for the same as the Drag To Scroll ), but MouseImp don't work on 64-bit system. I have long wanted to move to 64-bit system but could not increases with MouseImp. And I use mouse gestures in Opera browser. Drag To Scroll is a bit not as MouseImp, not a little sensitivity, etc. but hopefully I'll be able to configure it.
cheek, thanks you very much


Report this post
Top
  
Reply with quote  
 Post subject: Nice app!
PostPosted: April 13th, 2011, 11:52 am 
Hi cheek, thanks for sharing this little gem.

It makes working with my logitech trackman marble very close to perfect.

If I were to make some little suggestions, maybe the invertDrag should apply to both X- and Y-scrolling (that's what I expected). Alternatively, the two axes could each have an 'invert'-setting.

Tooltips on the settings GUI explaining the precise meaning of the various settings would also be nice for people who, like me, are too lazy to look it up. I find that moving the mouse very slowly yields no scrolling at all, which makes precision scrolling difficult. I'm sure one of the available settings would let me solve that niggle, but I haven't figured out which.

But the app is very useful as it is. I particularly like how you left it to the user which windows message to use. I primarily work in visual studio and it seems to only work with the 'WheelKey' scroll method, which is conveniently available.

Best regards
Lars Ole


Report this post
Top
  
Reply with quote  
PostPosted: May 3rd, 2011, 1:17 pm 
Offline

Joined: October 29th, 2004, 3:35 pm
Posts: 56
Hi, I'm very grateful for this script. I'm a graphic tablet user (wacom) and I've mapped the wheel button to the standard windows one.

I'm using it all the day and the scroll momentum is a dream made true. I think this script is a must have for any tablet user, sincerelly.

By the way, I've I'm missing something that can figure out how to do. I would like to be able to do a wheel gesture while holding modifier keys like a Wheel+control in Firefox to do zoom.

Is there any way to do it???

Thanks.


Report this post
Top
 Profile  
Reply with quote  
PostPosted: May 5th, 2011, 7:56 pm 
Offline

Joined: April 1st, 2009, 8:32 pm
Posts: 71
shader wrote:
Hi, I'm very grateful for this script. I'm a graphic tablet user (wacom) and I've mapped the wheel button to the standard windows one. I'm using it all the day and the scroll momentum is a dream made true. I think this script is a must have for any tablet user, sincerelly.

Thanks for the support; glad you enjoy it :) The best thing you can do for DtS is to promote it: tell your friends, blogs you read, facebook, or tweet. Thanks all!

shader wrote:
By the way, I've I'm missing something that can figure out how to do. I would like to be able to do a wheel gesture while holding modifier keys like a Wheel+control in Firefox to do zoom.

I'm really not sure what you mean here. I'm confused by "wheel gesture"; are you referring to the Up/Down/Left/Right gestures that DtS recognizes? Or are you actually talking about using the mousewheel itself? DtS does not actually do anything with the physical mousewheel at all. There are no hotkeys associated with the mousewheel, so DtS does not even know if you're using it, so its not really in the scope of this script; DtS is only concerned with clicking and dragging.

Perhaps if you told me more specifically what you are trying to do I can help.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 5th, 2011, 10:38 pm 
Offline

Joined: October 29th, 2004, 3:35 pm
Posts: 56
Quote:
I'm really not sure what you mean here. I'm confused by "wheel gesture"; are you referring to the Up/Down/Left/Right gestures that DtS recognizes? Or are you actually talking about using the mousewheel itself? DtS does not actually do anything with the physical mousewheel at all. There are no hotkeys associated with the mousewheel, so DtS does not even know if you're using it, so its not really in the scope of this script; DtS is only concerned with clicking and dragging.


Well, I mean "wheel gesture" as click and dragging Up/Down/Left/Right. Doing it in a graphic tablet seems like doing a gesture so I'm refering to it as that.

I just want to use the click and drag in conjuction with a modifier key (like alt, control, shift) to do things like zoom in the browser.

If I try to click and drag with another additional key like Control, pressing first control and after that the GtS button, it doesnt work. Otherwise, doing the oposite works ok, but it's not very convenient for me. In just a few words, I want to press first a modifier key and later the DtS button to scroll.

I hope you can figure out what I mean. Thanks for your help.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 6th, 2011, 2:48 am 
Offline

Joined: April 1st, 2009, 8:32 pm
Posts: 71
shader wrote:
I just want to use the click and drag in conjuction with a modifier key (like alt, control, shift) to do things like zoom in the browser.
I understand. Thanks for bringing this up, it is something I had considered, and seen intermittently work before (perhaps because I pressed the modifier key after starting scrolling). I will look more into this for the next release; there may be some unintended side effects, but this should work for you for now. Please let us know how this change works for you over time.

The issue here is that DtS is activated by the hotkey command which requires that you specify any modifier keys, and only works when those keys (or none) are held down when clicking the hotkey. You need to request that the hotkey be trigged regardless of any keys being held down, with the "*" hotkey modifier. DtS will essentially ignore the extra keys being held down and function as normal, however the targeted app should receive the simulated mousehweel and the modifier key. This should get you zooming in Firefox, etc.

Make the changes shown in red:
Code:
mnuEnabled:
  ScrollDisabled := !ScrollDisabled
  ToolTip("Scrolling " . (ScrollDisabled ? "Disabled" : "Enabled"), 1)
  GoSub, DragStop ; safety measure. force stop all drags
  mnuEnabledInit:
  if (!ScrollDisabled)
  {
    Menu, TRAY, Check, Enabled
    Menu, TRAY, tip, Drag To Scroll v%VERSION%
    HotKey, *%Button%, ButtonDown, On
    HotKey, *%Button% Up, ButtonUp, On
    ;HotKey, ^%Button%, DisabledButtonDown, On
    ;HotKey, ^%Button% Up, DisabledButtonUp, On
    HotKey, ~LButton, ToolTipCancel, On
  }
  else
  {
    Menu, TRAY, Uncheck, Enabled
    Menu, TRAY, tip, Drag To Scroll v%VERSION% (Disabled)
    HotKey, *%Button%, Off
    HotKey, *%Button% Up, Off
    ;HotKey, ^%Button%, Off
    ;HotKey, ^%Button% Up, Off
  }
   
  Gosub, UpdateTrayIcon
Return


A few caveats/issues with this change:
  • This will only work with the "WheelKey" and "WheelMessage" modes (the default)
  • This interferes with the Ctrl-Click (^) hotkeys which forces disabling DtS, so those hotkeys were commented out
  • The speed will probably be faster than you'd like, as it was designed for scrolling longer documents, not rapidly changing font size ;) You can adjust this and maybe find a happy medium in "All Settings". You'll also get momentum on zooming, if its enabled.

If you'd like to extend DtS' gestures (flicking Up/Down/Left/Right), you'll have to make the above change, as well as detecting the modifier keys in the gesture handler. Something like:
Code:
GestureU:
  if (GetKeyState("Alt", "P"))
  {
    MsgBox, Gesture Up while holding Alt
    return
  }
  ...
Return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 8th, 2011, 2:45 am 
Offline

Joined: October 29th, 2004, 3:35 pm
Posts: 56
Great! Many thanks for your response. This works very well now in firefox and other programs. It's strange but I can't get it to work with Chrome or Windows Explorer (windows 7).

I'l tell you about how is it working in my day to day work.

Quote:
The speed will probably be faster than you'd like, as it was designed for scrolling longer documents, not rapidly changing font size Wink You can adjust this and maybe find a happy medium in "All Settings". You'll also get momentum on zooming, if its enabled.


Well, you made me think about something I had in my mind from time ago... about using the pen pressure to the scroll speed "on the fly".

I've searched in the forum and I've found a script who does read the pen pressure using the wintab API > http://www.autohotkey.com/forum/viewtopic.php?t=65443&highlight=pressure. So I've tried to put it in the DtS script and it seems to work pretty well!

Code:
Scroll(arg, horizontal="", format="px")
{
  global
  local Direction, Factor, Method, wparam

  ; get the speed and direction from arg arg
  Direction := ( arg < 0 ? -1 : 1 ) * ( Get("InvertDrag") ? -1 : 1 )
  Factor := abs( arg )

if (tabletPressure < 700)
   SpeedY := "0.05"
if (tabletPressure < 950) && (tabletPressure > 700)
   SpeedY := "0.1"
if (tabletPressure > 1010)
   SpeedY := "0.4"

tooltip, P=%tabletPressure% %SpeedY%

  ; Special "hidden" setting, for edge cases (visual studio 2010)
  if (horizontal && Get("InvertDragX"))
    Direction *= -1

  ; Do the math to convert this raw px measure into scroll speed
  if (format = "px")
  {
    ; Scale by the user-set scroll speed & const adjust
    if (!horizontal)
      Factor *= SpeedY * Y_ADJUST
    else
      Factor *= Get("SpeedX") * X_ADJUST
 
    ; Scale by the acceleration function, if enabled
    if (!horizontal && Get("UseAccelerationY"))
      Factor := Accelerate(Factor)
    if (horizontal && Get("UseAccelerationX"))
      Factor := Accelerate(Factor)
  }


I've put the init at the start of the Button hotkey and the function at the end of the script. I think it's very very usefull to work with a tablet using it's pressure to adjust the scroll speed on the fly.

Please, tell me what do you think about this addition and if it could be enhanced.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 10th, 2011, 7:52 pm 
Offline

Joined: April 1st, 2009, 8:32 pm
Posts: 71
shader wrote:
Great! Many thanks for your response. This works very well now in firefox and other programs. It's strange but I can't get it to work with Chrome or Windows Explorer (windows 7).
Yeah, seeing the same; I think this is probably due to the way that these apps handle the mousewheel, FireFox seems to let windows handle it and only deals with windows messages, letting FFX know the MW was used. Chrome and IE appear to have more direct interaction with the hardware itself, and this is not something that can be changed. I did get better results with changing DtS' scroll method to "WheelKey" in Chrome. (search this thread for more info on scroll methods), but it was still a little rough.

shader wrote:
Please, tell me what do you think about this addition and if it could be enhanced.
This looks awesome, I will have to see if I can find my old tablet and try it out :) Implementation looks good.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 10th, 2011, 10:03 pm 
Offline
User avatar

Joined: March 1st, 2011, 12:46 am
Posts: 254
Whhoahh, amazing script!
If you can reduce the form in functions, I will use it every day!

_________________
Previously known as TomXIII
Image
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 31st, 2011, 5:48 pm 
Offline

Joined: April 1st, 2009, 8:32 pm
Posts: 71
I can't believe we're at 15,000 views! :)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 1st, 2011, 5:44 pm 
Offline
User avatar

Joined: March 1st, 2011, 12:46 am
Posts: 254
That's normal!

Do you plan to make a shorter code?!

_________________
Previously known as TomXIII
Image
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 1st, 2011, 6:50 pm 
Offline

Joined: April 1st, 2009, 8:32 pm
Posts: 71
R3gX wrote:
If you can reduce the form in functions, I will use it every day!
...
Do you plan to make a shorter code?!


Sorry, I'm not sure exactly what you were asking about. ...do you mean to make the script be able to be #included or copy/pasted in another script?

DtS was never designed to be a library or component, rather a full-featured open-source application, written in ahk. The script itself is quite large, because it contains a lot of optional features, documentation, settings, GUI code, and even embedded data. I have no plans to remove parts of the app or features. I like to keep as few copies of ahk running, and generally try to move code into my resident ahk script, but DtS has always been a standalone app. #including would almost certainly lead to variable name collisions, and I'm not even sure it could be 'portable' in its current format.

Can you tell me more about what you'd be looking for, so that I can keep it in mind for future revisions or future scripts?


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 177 posts ]  Go to page Previous  1 ... 6, 7, 8, 9, 10, 11, 12  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot] and 21 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group