AutoHotkey Community

It is currently May 26th, 2012, 11:28 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Scroll per pixel
PostPosted: November 15th, 2009, 7:31 pm 
Offline

Joined: November 15th, 2009, 6:54 pm
Posts: 82
Location: Berlin
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*


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 18th, 2009, 10:21 am 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
Have you seen Auto Scroll For Firefox :?:

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 18th, 2009, 6:30 pm 
@HotKeyIt
thats exactly wat i didn't mean

send, {WheelDown} or {WheelUp}
scrolls per lines...

i want to scroll pixelwise..not liines


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 19th, 2009, 11:44 am 
Offline

Joined: October 9th, 2006, 8:19 pm
Posts: 236
Location: Finland
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 19th, 2009, 4:24 pm 
Offline

Joined: November 15th, 2009, 6:54 pm
Posts: 82
Location: Berlin
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*


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Cerberus, Leef_me, Maestr0, Pulover, rbrtryn, Yahoo [Bot] and 67 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