AutoHotkey Community

It is currently May 27th, 2012, 12:14 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 120 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7, 8  Next
Author Message
 Post subject:
PostPosted: February 21st, 2008, 9:33 am 
Offline

Joined: January 30th, 2005, 11:18 pm
Posts: 133
Location: Darmstadt, Germany
automaticman wrote:
What is the most flexible use for the middle mouse button (as we have found a very good one for the wheel now). I would like to make it dependent on the used application. KatMouse seems to have an option for "pushing windows into the background" if I understood it correctly from the description on its website.

I do not use the "push down" functionality since I don´t need it. But you can configure another button than wheel button (if your mouse has additional ones) to push down windows. KatMouse has only limited per-application settings: you can deactive support for single applications but can not define different actions of mouse buttons for different apps. I use my mouse driver for these purposes (MS IntelliPoint driver).

But it gets off-topic now... If you have further questions, please email me directly.

regards,
Rob


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 21st, 2008, 5:04 pm 
Offline

Joined: October 27th, 2006, 10:12 am
Posts: 649
shimanov wrote:
Code:
CoordMode, Mouse, Screen
return

WheelUp::
   MouseGetPos, m_x, m_y
   hw_m_target := DllCall( "WindowFromPoint", "int", m_x, "int", m_y )

   ; WM_MOUSEWHEEL
   ;   WHEEL_DELTA = 120
   SendMessage, 0x20A, 120 << 16, ( m_y << 16 )|m_x,, ahk_id %hw_m_target%
return

WheelDown::
   MouseGetPos, m_x, m_y
   hw_m_target := DllCall( "WindowFromPoint", "int", m_x, "int", m_y )

   ; WM_MOUSEWHEEL
   ;   WHEEL_DELTA = 120
   SendMessage, 0x20A, -120 << 16, ( m_y << 16 )|m_x,, ahk_id %hw_m_target%
return
To make use of my so beloved markup:
~ I compare this solution to digging for oil very deeply to get the powerful oil. (Powerful in terms of "oil can be converted into power" meaning it's just one form of power among many other forms like e.g. money, beautiness, intelligence, physical power, military power, mass, accelerated objects, changing anything changeable in any space...)

Where does it's power come from:
+ DllCall
+ SendMessage
+ << operations (one needs some amount of understanding of Knuth's books here)

The used principle might be formulated like: "Connect simple events like here mouse over with low-level events using e.g. DllCall, SendMessage and bitshift operations."

If anyone wants to find a topic to write a nice tutorial about, the three big plus signs above might be some hints.


Report this post
Top
 Profile  
Reply with quote  
PostPosted: June 11th, 2008, 2:19 am 
Offline

Joined: June 8th, 2008, 11:50 pm
Posts: 9
Location: Spain - Madrid
I love mouse scrolling and use it a lot (now with Dexxa Mouse driver, which works for me with a Logitech wireless Mouse).

What I want is scrolling the control under the mouse, even if not active.

I tried this sample, derived from the documentation:

Code:
~RAlt & WheelDown::  ; Scroll right.
ControlGetFocus, fcontrol, A
MouseGetPos, , , id, control

Loop 1  ; <-- Increase this value to scroll faster.
{
    SendMessage, 0x114, 1, 0, %fcontrol%, A  ; 0x114 is WM_HSCROLL and the 1 after it is SB_LINELEFT.
    SendMessage, 0x114, 1, 0, %control%, A  ; 0x114 is WM_HSCROLL and the 1 after it is SB_LINELEFT.
}
return


It has 2 parts merged, because some applications are responsive to one kind and others to the other.

But it doesn't work in Excel, Access, etc.

Would it be easy to adapt your vertical examples (which I hadn't had time to try yet) to horizontal scrolling?

Thanks.

_________________
Regards.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 9th, 2009, 12:35 pm 
Offline

Joined: October 9th, 2006, 9:27 am
Posts: 21
shimanov wrote:
Here is a simple alternative. It actually works quite well. Well enough that I have finally removed KatMouse from my system.

note: should work with Windows 98+

Code:
CoordMode, Mouse, Screen
return

WheelUp::
   MouseGetPos, m_x, m_y
   hw_m_target := DllCall( "WindowFromPoint", "int", m_x, "int", m_y )

   ; WM_MOUSEWHEEL
   ;   WHEEL_DELTA = 120
   SendMessage, 0x20A, 120 << 16, ( m_y << 16 )|m_x,, ahk_id %hw_m_target%
return

WheelDown::
   MouseGetPos, m_x, m_y
   hw_m_target := DllCall( "WindowFromPoint", "int", m_x, "int", m_y )

   ; WM_MOUSEWHEEL
   ;   WHEEL_DELTA = 120
   SendMessage, 0x20A, -120 << 16, ( m_y << 16 )|m_x,, ahk_id %hw_m_target%
return


For me only this version work (scrolling breaks with others at all), but it scrolls only background window, no working scrolling with the foremost one. So I changed the shortcut to !Wheel, now i scroll foremost windows without Alt and background windows with it.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 10th, 2009, 11:10 am 
Offline

Joined: December 13th, 2006, 7:10 am
Posts: 118
Another varaint; mostly cosmetic changes:
Code:
CoordMode, Mouse, Screen
SetWinDelay, -1
SetBatchLines,-1
SetKeyDelay, -1

; acceleration
_WHEELACC=0x280000
; max speed
_WHEELMAXN=0x1800000
; automatically activate window
_WHEELAUTOFOCUS=1

return


EasyWheel(d)
; if _WHEELAUTOFOCUS if set, check which window is under the mouse and gives it focus if it hasn't already
; then send scroll event to the control under the mouse
; original code from Shimanov: http://www.autohotkey.com/forum/viewtopic.php?t=6772#54821
{
Global _WHEELACC
   , _WHEELMAXN
   , _WHEELAUTOFOCUS
Static t, s


   if ( A_TickCount > 500+t) {
      t := A_TickCount
      s :=0x780000
   }
   else if (s < _WHEELMAXN)
      s += _WHEELACC

   MouseGetPos x, y, hwnd
   h := DllCall("WindowFromPoint", "int", x, "int", y)
   if _WHEELAUTOFOCUS && (hwnd<>WinExist("A"))
      WinActivate, ahk_id %hwnd%
   SendMessage, 0x20A, d*s,(y<<16)|x,, ahk_id %h%
}


WheelUp:: EasyWheel(1)
WheelDown:: EasyWheel(-1)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 25th, 2009, 10:40 am 
Offline

Joined: March 27th, 2008, 7:46 pm
Posts: 129
Location: France
sashabe wrote:
shimanov wrote:
Here is a simple alternative. It actually works quite well. Well enough that I have finally removed KatMouse from my system.

note: should work with Windows 98+

Code:
CoordMode, Mouse, Screen
return

WheelUp::
   MouseGetPos, m_x, m_y
   hw_m_target := DllCall( "WindowFromPoint", "int", m_x, "int", m_y )

   ; WM_MOUSEWHEEL
   ;   WHEEL_DELTA = 120
   SendMessage, 0x20A, 120 << 16, ( m_y << 16 )|m_x,, ahk_id %hw_m_target%
return

WheelDown::
   MouseGetPos, m_x, m_y
   hw_m_target := DllCall( "WindowFromPoint", "int", m_x, "int", m_y )

   ; WM_MOUSEWHEEL
   ;   WHEEL_DELTA = 120
   SendMessage, 0x20A, -120 << 16, ( m_y << 16 )|m_x,, ahk_id %hw_m_target%
return


For me only this version work (scrolling breaks with others at all), but it scrolls only background window, no working scrolling with the foremost one. So I changed the shortcut to !Wheel, now i scroll foremost windows without Alt and background windows with it.


Good and Great for me to, i like the scrolling without windows focused,
Simple and Effective, big thank's AHK-Forum

_________________
with ahk, all is different!...<img>


Report this post
Top
 Profile  
Reply with quote  
PostPosted: August 19th, 2009, 6:06 pm 
Offline

Joined: August 19th, 2009, 5:17 pm
Posts: 1
I found a program that doesn't like the very elegant solution by shimanov: Trillian Astra. Wheel scrolling doesn't work at all in Trillian's message windows while this script is active.

As a workaround, I look to see what the active app and hovered app are and send the default wheel messages if they are both trillian.exe. Unfortunately, that means no "hover scroll" for Trillian, but that's better than no wheel scrolling at all!

Code:
$WheelUp::
   MouseGetPos, m_x, m_y
   hw_m_target := DllCall( "WindowFromPoint", "int", m_x, "int", m_y )
   WinGet,hoverproc,ProcessName,ahk_id %hw_m_target%
   WinGet,activeproc,ProcessName,A
   if (hoverproc = "trillian.exe" and activeproc = "trillian.exe")
   {
     Send,{WheelUp}
   }
   else
   {
     SendMessage, 0x20A, 120 << 16, ( m_y << 16 )|m_x,, ahk_id %hw_m_target%
   }
return

$WheelDown::
   MouseGetPos, m_x, m_y
   hw_m_target := DllCall( "WindowFromPoint", "int", m_x, "int", m_y )
   WinGet,hoverproc,ProcessName,ahk_id %hw_m_target%
   WinGet,activeproc,ProcessName,A
   if (hoverproc = "trillian.exe" and activeproc = "trillian.exe")
   {
     Send,{WheelDown}
   }
   else
   {
     SendMessage, 0x20A, -120 << 16, ( m_y << 16 )|m_x,, ahk_id %hw_m_target%
   }
return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 13th, 2009, 12:20 pm 
Offline

Joined: October 13th, 2009, 11:56 am
Posts: 100
Hi there!

I need your help. I know nothing about scripting/programming at all, so please, if it's not that hard for you: could you please adopt this script for my needs?

I use Firefox, Total Commander and Miranda (TabSRMM chat container + clist_modern). All these progs use tabs. Miranda and Firefox have it's own abilities to scroll tabs, and Total Commander hasn't.

I want to have a script that will be able to scroll anything under the cursor without activating it (and without scroll acceleration).

I've tried all of the scripts from this topic and each of them does only part of what I need, but this parts are different, so maybe it's possible to mix all the advantages of these scripts, throw away all disadvantages and then combine them into one single script.

Here are the exact details of what I need:
1. No activation of the scrollable objects.
2. Tab scroll for the 3 programs mentioned above.
3. No scroll acceleration.

In order to try to help you helping me:
The only script that partially (it has some bugs) supports scroll for miranda's container tabs is TheLeO's version of the script.

All other scripts brake the built-in ability of (at least) Miranda (or even Firefox's too). But even this script is not bug-free: when scrolling active window of chat log or tabs in the chat container (TabSRMM), it also scrolls contact list (bug works only for my lovely clist_modern, but not for clist_nicer, btw).

EDIT:
Code:
#SingleInstance force
; Run total commander.
Run, TOTALCMD.EXE

; Wait until it opens.
WinWait, ahk_class TTOTAL_CMD

; Setting timer to check if the process still alive.
SetTimer, CheckTC, On

WheelUp::
WheelDown::
  MouseGetPos, MouseX, MouseY, WinID, ControlNN, 1
  WinGetClass, WinClass, % "ahk_id " WinID

  ; Scrolling TotalCommander's tabs
  If (WinClass = "TTOTAL_CMD" && RegExMatch(ControlNN, "TMyTabControl[12]"))
  { PostMessage, 1075, % TC_Cmd := "400" (ControlNN = "TMyTabControl1" ? "1" : "2"), 0,, % "ahk_class " WinClass
    PostMessage, 1075, % TC_Cmd := "300" (A_ThisHotkey = "WheelDown" ? "5" : "6"), 0,, % "ahk_class " WinClass
  }

  ; Scrolling objects under cursor without activation.
  Else, PostMessage 0x20A, ((A_ThisHotKey="WheelUp")-.5)*A_EventInfo*(120<<17),(MouseY<<16)|MouseX, % ControlNN, % "ahk_id " WinID
Return

CheckTC:
  Process, Exist, TOTALCMD.EXE
  If !ErrorLevel
    ExitApp
Return

This script was written by Mad*Forces / ZeLen1y under WTFPL license and it works best for TotalCommander - it can scroll inactive part of window without activating it, can scroll tabs of (in)active part of window, can scroll foreground applications and explorer windows, also without activating them, but it works bad with firefox: if firefox is not active, and I try to scroll tabs or tab's content - nothing happens.
It works good with (in)active TabSRMM chat container, but not with it's tabs.
Please, ignore the timer, as this script was written specially for me and I really requested that thing.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 15th, 2009, 2:37 pm 
Offline

Joined: October 13th, 2009, 11:56 am
Posts: 100
please, don't ignore my post, I really need help badly! :(


Report this post
Top
 Profile  
Reply with quote  
PostPosted: February 18th, 2010, 4:52 pm 
Offline

Joined: October 13th, 2009, 10:09 pm
Posts: 1389
thx1200 wrote:
I found a program that doesn't like the very elegant solution by shimanov: Trillian Astra. Wheel scrolling doesn't work at all in Trillian's message windows while this script is active.

As a workaround, I look to see what the active app and hovered app are and send the default wheel messages if they are both trillian.exe. Unfortunately, that means no "hover scroll" for Trillian, but that's better than no wheel scrolling at all!

Code:
$WheelUp::
   MouseGetPos, m_x, m_y
   hw_m_target := DllCall( "WindowFromPoint", "int", m_x, "int", m_y )
   WinGet,hoverproc,ProcessName,ahk_id %hw_m_target%
   WinGet,activeproc,ProcessName,A
   if (hoverproc = "trillian.exe" and activeproc = "trillian.exe")
   {
     Send,{WheelUp}
   }
   else
   {
     SendMessage, 0x20A, 120 << 16, ( m_y << 16 )|m_x,, ahk_id %hw_m_target%
   }
return

$WheelDown::
   MouseGetPos, m_x, m_y
   hw_m_target := DllCall( "WindowFromPoint", "int", m_x, "int", m_y )
   WinGet,hoverproc,ProcessName,ahk_id %hw_m_target%
   WinGet,activeproc,ProcessName,A
   if (hoverproc = "trillian.exe" and activeproc = "trillian.exe")
   {
     Send,{WheelDown}
   }
   else
   {
     SendMessage, 0x20A, -120 << 16, ( m_y << 16 )|m_x,, ahk_id %hw_m_target%
   }
return


I think trillian needs the scroll event to be send to the textbox control in chat window. With a scroll script active, it scrolls only if I have the cursor over the textbox area. Unfortunately the ClassNN is the same for the chat log control above it, and if you use Tabs, the number at the end of classNN appears to be random. Comparing the positions and visibility of the controls might be a way to find the correct one.

I also noticed another program that has issues with it, AdiIRC (probably not so common, but I use it). It zooms the chat window when you scroll too fast...


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 23rd, 2010, 12:03 am 
Offline

Joined: February 22nd, 2010, 11:58 pm
Posts: 1
soggos wrote:
sashabe wrote:
shimanov wrote:
Here is a simple alternative. It actually works quite well. Well enough that I have finally removed KatMouse from my system.

note: should work with Windows 98+

Code:
CoordMode, Mouse, Screen
return

WheelUp::
   MouseGetPos, m_x, m_y
   hw_m_target := DllCall( "WindowFromPoint", "int", m_x, "int", m_y )

   ; WM_MOUSEWHEEL
   ;   WHEEL_DELTA = 120
   SendMessage, 0x20A, 120 << 16, ( m_y << 16 )|m_x,, ahk_id %hw_m_target%
return

WheelDown::
   MouseGetPos, m_x, m_y
   hw_m_target := DllCall( "WindowFromPoint", "int", m_x, "int", m_y )

   ; WM_MOUSEWHEEL
   ;   WHEEL_DELTA = 120
   SendMessage, 0x20A, -120 << 16, ( m_y << 16 )|m_x,, ahk_id %hw_m_target%
return


For me only this version work (scrolling breaks with others at all), but it scrolls only background window, no working scrolling with the foremost one. So I changed the shortcut to !Wheel, now i scroll foremost windows without Alt and background windows with it.


Good and Great for me to, i like the scrolling without windows focused,
Simple and Effective, big thank's AHK-Forum


Thanks for this. I like it a lot. One thing, I used to have "~LControl & WheelUp" and down mapped to scroll to the left and right. It of course broke when I started using this script.

I tried replacing "0x20A" with "0x114" which is "WM_HSCROLL" which was used in my old hotkey, but that doesn't do anything. Am I missing something?

Thanks.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 21st, 2010, 4:38 pm 
Offline

Joined: May 21st, 2007, 11:12 pm
Posts: 34
Thank you, shimanov!!
Solves soo many problems.

For those that integrated this in your big script, like me, you have to put the following line at the top of your script or you'll have some problems:
Code:
CoordMode, Mouse, Screen

(I don't think "return" below that is needed)


Report this post
Top
 Profile  
Reply with quote  
PostPosted: April 28th, 2010, 6:32 pm 
Offline

Joined: May 21st, 2007, 11:12 pm
Posts: 34
fragman wrote:
thx1200 wrote:
I found a program that doesn't like the very elegant solution by shimanov: Trillian Astra. Wheel scrolling doesn't work at all in Trillian's message windows while this script is active.

As a workaround, ....


I think trillian needs the scroll event to be send to the textbox control in chat window. With a scroll script active, it scrolls only if I have the cursor over the textbox area. ...

Confirmed! shimanov's solution doés work on Trillian Astra if you position you cursor over the chat input area (where you type your text), even if not active. (And otherwise it indeed doesn't. Unfortunate..)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 9th, 2010, 5:41 pm 
Offline

Joined: May 21st, 2007, 11:12 pm
Posts: 34
I recently migrated to Autohotkey_L and shimanov's solution stopped working, I am afraid. Anyone know any solution?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 8th, 2010, 12:31 pm 
Offline

Joined: March 23rd, 2006, 2:20 pm
Posts: 128
Quote:
I recently migrated to Autohotkey_L and shimanov's solution stopped working, I am afraid. Anyone know any solution?


Shimanov's solution stopped working for me too when I migrated from Autohotkey_L 32-bit to Autohotkey_L 64-bit version.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 120 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7, 8  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Maestr0, Rajat and 57 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