AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

WindowPad - multi-monitor window-moving tool
Goto page Previous  1, 2, 3 ... 11, 12, 13 ... 15, 16, 17  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
Lexikos



Joined: 17 Oct 2006
Posts: 4467
Location: Qld, Australia

PostPosted: Thu Mar 19, 2009 1:38 pm    Post subject: Reply with quote

You may use the following directly in a script (with or without WindowPad):
Code:
SysGet, x, 76
SysGet, y, 77
SysGet, w, 78
SysGet, h, 79
WinMove, A,, x, y, w, h
See SysGet and WinMove for more information.
Back to top
View user's profile Send private message Visit poster's website
korosif
Guest





PostPosted: Fri Mar 20, 2009 3:03 pm    Post subject: Re: maximize using both screens Reply with quote

korosif wrote:

Can I make an hotkey to maximize a window using both of my screens (as if they were one giant screen)?


Thank you Lexikos, again Very Happy

If someone is interested to add a multi-full-screen hotkey at WindowPad, here what I did:

I don't know how to setup WindowPad for this (I only use the .ini to configure), so I delete the #Numpad5 hotkey in the WindowPad.ini and put this script in my startup folder:

Code:
#Numpad5:: ; full-multi-screen
SysGet, x, 76
SysGet, y, 77
SysGet, w, 78
SysGet, h, 79
WinMove, A,, x, y, w, h-30
return


You could have to finetune the 'h-30' part considering the height of your taskbar...


On another note, I did have to remove the Numkey0 hotkeys, because with my logitech confort keyboard, as soon as I typed a 0 and then some numbers quickly, the WindowPad hotkey was getting fired, as if I didn't released the Num0 key.
Am I the only one? Is there a workaround?
Back to top
Lexikos



Joined: 17 Oct 2006
Posts: 4467
Location: Qld, Australia

PostPosted: Fri Mar 20, 2009 3:25 pm    Post subject: Re: maximize using both screens Reply with quote

korosif wrote:
as if I didn't released the Num0 key.
If you type quickly enough, you will press the second key before releasing the first one. The script can't look into the future and see that you are going to release the key in a few milliseconds, so you must tell it to wait. For instance, find this_hotkey := A_ThisHotkey in Hotkeys() and add below it:
Code:
Input, n, T0.2 ; Wait for input for 0.2 seconds.
if n != ; If input was received, cancel.
{ ; Oversimplified (works only with simple hotkeys):
    Send {%A_ThisHotkey%}{Raw}%n%
    return
}
If you don't use the Numpad0 hotkeys, you should remove them from the ini. WindowPad.ini exists to be customized.
Back to top
View user's profile Send private message Visit poster's website
gposton
Guest





PostPosted: Mon Apr 06, 2009 6:21 pm    Post subject: New Command Reply with quote

I'd like to see functionality like alt-tab and alt-f4 in this app.
Back to top
Lexikos



Joined: 17 Oct 2006
Posts: 4467
Location: Qld, Australia

PostPosted: Wed Apr 08, 2009 10:40 am    Post subject: Reply with quote

I was going to rant about how implementing such unrelated features would be outside the scope of WindowPad, but then I realised I'd already implemented a "Send" pseudo-command. You may put something like the following in a Hotkeys section within WindowPad.ini:
Code:
r = Send, !{Tab}
v = Send, !{F4}
r and v may be changed to whichever keys you want. Unlike actual AutoHotkey script, comma is required. If that does not suffice, arbitrary AutoHotkey code contained by WindowPad.ahk may be called from the ini file; for instance, WindowPad executes r = Send, !{Tab} by setting Params to !{Tab} and calling the Send subroutine, which is near the end of WindowPad.ahk. The actual code for it is as follows:
Code:
Send:
    Send, %Params%
    return

Alternately, hotkeys (and any other AutoHotkey code) may be placed directly in WindowPad.ahk. (WindowPad.exe cannot be extended or customized beyond editing WindowPad.ini.)
Back to top
View user's profile Send private message Visit poster's website
jkdufair



Joined: 26 Aug 2005
Posts: 2

PostPosted: Fri Apr 10, 2009 7:10 pm    Post subject: Thank you! Reply with quote

Thank you for this script. It's a work of art and a fine utility!
Back to top
View user's profile Send private message
WindowPadFan
Guest





PostPosted: Mon Apr 13, 2009 10:29 am    Post subject: Reply with quote

I love this script. However I prefer to move my windows under the mouse cursor to the next screen with a middle click. Here is how I did it:


I added the following to [Hotkeys] section
*MButton = WindowScreenMove, Next

and modified the code by adding the following line

Send, {Click}

after

WindowScreenMove(P)
{
SetWinDelay, 0

Hope this is useful to some
Back to top
Lexikos



Joined: 17 Oct 2006
Posts: 4467
Location: Qld, Australia

PostPosted: Mon Apr 13, 2009 10:40 am    Post subject: Reply with quote

WindowPad already had a feature to move the window which is under the mouse cursor: WindowScreenMove, Next, M. Confused
Back to top
View user's profile Send private message Visit poster's website
WindowPadFan
Guest





PostPosted: Mon Apr 13, 2009 11:03 am    Post subject: Reply with quote

Indeed. It is even documented (just hidden in "Window titles" which I didn't read).

So only
*MButton = WindowScreenMove, Next
is needed.

Thanks Lexikos, you are the greatest!
Back to top
Lexikos



Joined: 17 Oct 2006
Posts: 4467
Location: Qld, Australia

PostPosted: Mon Apr 13, 2009 11:49 am    Post subject: Reply with quote

I guess you meant:
Code:
*MButton = WindowScreenMove, Next, M
Wink
Back to top
View user's profile Send private message Visit poster's website
JaseF_Is_Guesting
Guest





PostPosted: Mon Apr 13, 2009 12:04 pm    Post subject: Window Move without Resize Reply with quote

Further to a post earlier, I am still trying to get WindowPad to move windows ultra quick. The best way (I've found) is to move the window without resizing (and I'm happy to use monitors with the same resolution so it works easily).

Based on advice provided by Lexicos earlier, I have tried deleting and/or commenting out the following code (in fact I've even tried newting everything except the return):

if (IsResizable()) {
w := Round(w*(mdw/msw))
h := Round(h*(mdh/msh))
}

but I'm still getting window resizes before the move using WindowPad v1.55.

I am expecting the following custom entry into the INI file to still use the code above, but perhaps this is where things are going wrong?

[Hotkeys]
^!M = WindowScreenMove, Next

Thanks for your help!
Back to top
Lexikos



Joined: 17 Oct 2006
Posts: 4467
Location: Qld, Australia

PostPosted: Mon Apr 13, 2009 10:46 pm    Post subject: Reply with quote

Commenting out those lines works for me. Did you reload the script?
Back to top
View user's profile Send private message Visit poster's website
WindowPadFan
Guest





PostPosted: Tue Apr 14, 2009 12:00 am    Post subject: Reply with quote

Lexikos, correct Smile Thanks!

WindowPadFan wrote:
Indeed. It is even documented (just hidden in "Window titles" which I didn't read).

So only
*MButton = WindowScreenMove, Next
is needed.

Thanks Lexikos, you are the greatest!
Back to top
JaseF



Joined: 13 Mar 2008
Posts: 33

PostPosted: Tue Apr 14, 2009 2:37 am    Post subject: Reply with quote

I replaced about four instances of the exact code (prepending with Wink and then reloaded the script but still get the same behavior every time I try to move a maximised window using Ctrl-Alt-M.

I imagine I am doing something wrong like usual, but can't see what. I've uploaded the changed file here if you have time:

http://members.iinet.net.au/~oliviaconnolly/WindowPad_NoResize.zip

Incidentally, the custom hotkey:
^!NumpadSub = WindowPadMove, 0, 0, 1.0, 1.0
(Ctrl-Alt-Win Numpad - in the file above)
behavior also seems a little weird. It resizes the window to be a tiny bit smaller (which is great) sometimes, but others times it swaps the window to another screen. Is this because I've stripped out the resize bits?
_________________
Note: Assistance provided to me may be used for Commercial purposes (ie: I will be trying to sell software products based on AHK). Please see the following for further details:

http://www.autohotkey.com/forum/viewtopic.php?t=34333
Back to top
View user's profile Send private message
Lexikos



Joined: 17 Oct 2006
Posts: 4467
Location: Qld, Australia

PostPosted: Tue Apr 14, 2009 10:59 am    Post subject: Reply with quote

Using the provided files on my system, ^!m does not resize the window. I have two monitors: one at 1680x1050 and another at 1920x1080.
Quote:
It resizes the window to be a tiny bit smaller (which is great) sometimes,
Since you've disabled the code which calculates the new size, it should always be the same as the current size. Although the script actually gets the current size and passes it to WinMove, this should be the same as omitting the width and height - unless the window size changes between WinGetPos and WinMove. To be sure, you may remove ", neww, newh" from the WinMove line in MoveWindowInDirection() and ", w, h" from the WinMove line in WindowScreenMove().
Quote:
but others times it swaps the window to another screen.
This behaviour is by design - if the window is already exactly in place, rather than doing nothing the script moves the window to the next screen. This is implemented by the block beginning with:
Code:
if (newx "," newy "," neww "," newh) = (x "," y "," w "," h)
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page Previous  1, 2, 3 ... 11, 12, 13 ... 15, 16, 17  Next
Page 12 of 17

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group