AutoHotkey Community

It is currently May 26th, 2012, 4:06 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 337 posts ]  Go to page Previous  1 ... 9, 10, 11, 12, 13, 14, 15 ... 23  Next
Author Message
 Post subject:
PostPosted: March 19th, 2009, 1:38 pm 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7502
Location: Australia
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.


Report this post
Top
 Profile  
Reply with quote  
PostPosted: March 20th, 2009, 3:03 pm 
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 :D

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?


Report this post
Top
  
Reply with quote  
PostPosted: March 20th, 2009, 3:25 pm 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7502
Location: Australia
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: New Command
PostPosted: April 6th, 2009, 6:21 pm 
I'd like to see functionality like alt-tab and alt-f4 in this app.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 8th, 2009, 10:40 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7502
Location: Australia
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.)


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Thank you!
PostPosted: April 10th, 2009, 7:10 pm 
Offline

Joined: August 26th, 2005, 3:35 pm
Posts: 2
Thank you for this script. It's a work of art and a fine utility!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 13th, 2009, 10:29 am 
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


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 13th, 2009, 10:40 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7502
Location: Australia
WindowPad already had a feature to move the window which is under the mouse cursor: WindowScreenMove, Next, M. :?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 13th, 2009, 11:03 am 
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!


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 13th, 2009, 11:49 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7502
Location: Australia
I guess you meant:
Code:
*MButton = WindowScreenMove, Next, M
;)


Report this post
Top
 Profile  
Reply with quote  
PostPosted: April 13th, 2009, 12:04 pm 
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!


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 13th, 2009, 10:46 pm 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7502
Location: Australia
Commenting out those lines works for me. Did you reload the script?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 14th, 2009, 12:00 am 
Lexikos, correct :-) 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!


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 14th, 2009, 2:37 am 
Offline

Joined: March 13th, 2008, 11:37 am
Posts: 37
I replaced about four instances of the exact code (prepending with ;) 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/~oliviaconn ... Resize.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/viewtop ... highlight=


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 14th, 2009, 10:59 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7502
Location: Australia
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)


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 337 posts ]  Go to page Previous  1 ... 9, 10, 11, 12, 13, 14, 15 ... 23  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 13 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