Welcome Guest.   Make a donation to an author on the site October 24, 2014, 07:49:50 AM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
View the new Member Awards and Badges page.
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: Scrolling windows other than the active one  (Read 3125 times)
jgpaiva
Global Moderator
*****
Posts: 4,710



Artificial Idiocy

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« on: February 23, 2006, 04:44:51 AM »

When i got myself another monitor, the feature that i looked for the most was the ability to code in one monitor and see the "what to do" list on the other monitor.
But the problem was that i had to scroll the window with the "to do list" and for that, I'd have to use my mouse, or alt-tab into it.
So, i created a ahk script to do what the ctrl+meta+v key does in emacs: scroll the other window.
This script has the ability of storing 9 windows and scroll each of them, restoring the focus to the original window after it scrolls the others.
In early times, it used MW_VSCROLL message, but that message doesn't work with adobe acrobat, so, i changed it to the "send" keys, so now it activates the window, sends specified keys to scroll the window, and reactivates the last window.
I hope you like it:

[copy or print]
#SingleInstance, Force

;Pressing win+alt+numpad# stores the current window under #.
;For scrolling up the # window, press win+#
;For scrolling down the #window, press ctrl+win+#
KeyUp={Up} ;the Up arrow will be sent to scroll up
KeyDown={Down} ;the down arrow will be sent to scroll the window down.
;To use the page up and down to scroll the windows, replace 'up' and
;'down' by PgUp and PgDn
loop 9
{
  MMWindow%A_Index%=
  MMWinCtrl%A_Index%=
  Hotkey,!#Numpad%A_Index%, Save
  Hotkey,#NumPad%A_Index%, ScrollDown
  Hotkey,^#NumPad%A_Index%, ScrollUp
}
return

Save:
  StringRight, MMKeyID, A_ThisHotkey, 1
  MMWindow%MMKeyID% :=WinActive("a")
  MouseGetPos, , , , MMWinCtrl%MMKeyID%,
  Return
 
ScrollDown:
  LastWindow :=WinActive("a")
  StringRight, MMKeyID, A_ThisHotkey, 1
  MMWinID :=(MMWindow%MMKeyID%)
  MMWinCtrlID := (MMWinCtrl%MMKeyID%)
  WinActivate, ahk_id %MMWinID%
  loop
  {
    Send,{Down}
    GetKeyState, state, Numpad%MMKeyID%, P
    If state = u
      break
  }
  WinActivate, ahk_id %LastWindow%
  return

ScrollUp:
  LastWindow :=WinActive("a")
  StringRight, MMKeyID, A_ThisHotkey, 1
  MMWinID :=(MMWindow%MMKeyID%)
  MMWinCtrlID := (MMWinCtrl%MMKeyID%)
  WinActivate, ahk_id %MMWinID%
  loop
  {
    Send,%KeyUp%
    GetKeyState, state, Numpad%MMKeyID%, P
    If state = u
      break
  }
  WinActivate, ahk_id %LastWindow%
  return
« Last Edit: February 23, 2006, 05:36:26 AM by jgpaiva » Logged

brotherS
Master of Good Ideas
Honorary Member
**
Posts: 2,105


To make a difference, be different.

View Profile Give some DonationCredits to this forum member
« Reply #1 on: February 23, 2006, 04:52:10 AM »

Nice idea! Now all I need is a second monitor  Grin
Logged

Thank you.
Kniht
Charter Member
***
Posts: 8

View Profile WWW Give some DonationCredits to this forum member
« Reply #2 on: February 23, 2006, 05:00:59 AM »

While you're at it, get me a second monitor too. This external video jack is just going to waste.
Logged
jgpaiva
Global Moderator
*****
Posts: 4,710



Artificial Idiocy

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #3 on: February 23, 2006, 05:25:19 AM »

Nice idea! Now all I need is a second monitor  Grin
You don't really need a second monitor, this works for every window, not necessarily for windows in a second monitor.
With a few tweaks, this can work like a "fast reference" script. You can press a key to activate the window and release it to return to the window you were using before. A quite useful feature Wink
Logged

Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.026s | Server load: 0.02 ]