 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
GDur
Joined: 15 Nov 2009 Posts: 82 Location: Berlin
|
Posted: Sun Nov 15, 2009 6:31 pm Post subject: Scroll per pixel |
|
|
I wrote a AHK script wich can scroll like firefox.
U can press the middle mousekey ( MButton Down) and move the mouse up or down....then u scroll up or down.
I don't scroll per pixel but per lines.
but i want to scroll per pixel:
this is what i have until now:
| Code: |
#Persistent
SetTimer, WatchScrollBar, 100
return
WatchScrollBar:
ActiveWindow := WinExist("A")
if not ActiveWindow ; No active window.
return
ControlGetFocus, FocusedControl, ahk_id %ActiveWindow%
if not FocusedControl ; No focused control.
return
else
{
ControlGet, ChildHWND, Hwnd,, %FocusedControl%, ahk_id %ActiveWindow%
DllCall("ScrollWindowEx" , UInt, ChildHWND, Int, 0, Int, -1, Int, NULL, Int, NULL)
}
return
|
if u execute this coce the active window will move up but in a crappy way...and it don't scrolls not in a usual way.
Please help me with this problem.
the best script u could give to me is a code with a function like that i think:
scrollPerPixel(hwnd, speed, horizontalORvertical)
that i can use it like: scrollPerPixel(hwnd, 3, 0) ; 3 stands for the pixel( up or down per minus oder plus)| and 0 stands for horizintal or vertical
THAAAANX
if there' any questions becouse i wrote: please ask or contact me
details to the actual FRAn-FireScroll:
the programm is updateable and..
it distinguishes between a hight distance ( == hightspeed scroll) and lowspeed.
but there's a compromis. I use the standardscroll-line:
start > system configuration > mouse > wheel > "lines per scroll" = 1
and then if someone Scroll's down....i simulate more scrolls (i made new options for this)
there's a table where u can add programs in wich u don't want to scroll like in firefox
any way...
downloadLink: http://gdur.cerebrumsoft.org/FRAn-FireScroll/FRAn-FireScroll.rar
i swear that there is no kiddy-virus or somesing like that inside.
but i can undestand if u are sceptic _________________ *can't live without AHK* |
|
| Back to top |
|
 |
HotKeyIt
Joined: 18 Jun 2008 Posts: 4652 Location: AHK Forum
|
|
| Back to top |
|
 |
Guest
|
Posted: Wed Nov 18, 2009 5:30 pm Post subject: |
|
|
@HotKeyIt
thats exactly wat i didn't mean
send, {WheelDown} or {WheelUp}
scrolls per lines...
i want to scroll pixelwise..not liines |
|
| Back to top |
|
 |
svi
Joined: 09 Oct 2006 Posts: 236 Location: Finland
|
Posted: Thu Nov 19, 2009 10:44 am Post subject: |
|
|
Scroll notepad:
Hotkeys: 0-9 for speed, up & down for direction, ESC to exit.
Just run it (language independent)!
| Code: | SplitPath A_AhkPath, , AhkDir
Run Notepad.exe %AhkDir%\license.txt, , , pID
WinWait ahk_pid %pID%
ControlMove Edit1, , , , 10000
d = -1 ; direction
step = 1
delay = 5
Loop
{
start := A_TickCount
ControlGetPos, , y, , , Edit1
y := y + d * step
ControlMove Edit1, , y
Sleep % delay
ToolTip % "Speed " step * (Abs(d) * 1000 / (A_TickCount - start)) " pixels / s"
}
Up:: d = 1
Down:: d = -1
0:: step = 0
1:: delay := 50, step := 1
2:: delay := 33, step := 1
3:: delay := 17, step := 1
4:: delay := 0, step := 1
5:: delay := 0, step := 2
6:: delay := 0, step := 4
7:: delay := 0, step := 6
8:: delay := 0, step := 8
9:: delay := 0, step := 10
Esc::
WinClose ahk_pid %pID%
ExitApp |
_________________ Pekka Vartto |
|
| Back to top |
|
 |
GDur
Joined: 15 Nov 2009 Posts: 82 Location: Berlin
|
Posted: Thu Nov 19, 2009 3:24 pm Post subject: |
|
|
| svi wrote: | Scroll notepad:
Hotkeys: 0-9 for speed, up & down for direction, ESC to exit.
Just run it (language independent)!
| Code: | SplitPath A_AhkPath, , AhkDir
Run Notepad.exe %AhkDir%\license.txt, , , pID
WinWait ahk_pid %pID%
ControlMove Edit1, , , , 10000
d = -1 ; direction
step = 1
delay = 5
Loop
{
start := A_TickCount
ControlGetPos, , y, , , Edit1
y := y + d * step
ControlMove Edit1, , y
Sleep % delay
ToolTip % "Speed " step * (Abs(d) * 1000 / (A_TickCount - start)) " pixels / s"
}
Up:: d = 1
Down:: d = -1
0:: step = 0
1:: delay := 50, step := 1
2:: delay := 33, step := 1
3:: delay := 17, step := 1
4:: delay := 0, step := 1
5:: delay := 0, step := 2
6:: delay := 0, step := 4
7:: delay := 0, step := 6
8:: delay := 0, step := 8
9:: delay := 0, step := 10
Esc::
WinClose ahk_pid %pID%
ExitApp |
|
Thanks but that is not accurat enought.
in youre example the scrollbars slides up.
that should not happens
i think it has to be moved with dllcall's
afaik ahk got no directly method to do this like i wish _________________ *can't live without AHK* |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|