AutoHotkey Community

It is currently May 27th, 2012, 4:54 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: move Winodows
PostPosted: October 6th, 2004, 8:52 am 
Offline

Joined: September 4th, 2004, 8:44 pm
Posts: 74
Location: UK
these key definitions enable you to move the active window around the screen using Windows+Up, Windows+Down, Windows+Left, Windows+Right.

not exactly fancy but, as a keyboard sort of person, i find them very handy.

jack
It's not the despair - I can stand the despair. It's the hope


Code:
; move active window 100 pixels right
#right::
   wingetpos x, y,,, A   ; get coordinates of the active window
   x += 100           ; add 100 to the x coordinate
   winmove, A,,%x%, %y%  ; make the active window use the new coordinates
   return              ; finish

; move active window 100 pixels left
#left::
   wingetpos x, y,,, A
   x -= 100
   winmove, A,,%x%, %y%
   return

; move active window 100 pixels up
#Up::
   wingetpos x, y,,, A
   y -= 100
   winmove, A,,%x%, %y%
   return

; move active window 100 pixels down
#Down::
   wingetpos x, y,,, A
   y += 100
   winmove, A,,%x%, %y%
   return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 6th, 2004, 9:04 am 
Cool, thx jack.

:D


Report this post
Top
  
Reply with quote  
 Post subject: Um...
PostPosted: November 11th, 2004, 9:07 pm 
Wtf happened to alt+space ~ m? Or do you feel that those extra 300 milliseconds of your life could be spent doing better things? I can see hotkeys for batches or running programs, but extremely basic things like closing a window, switching tasks, or moving windows around using the keyboard have already been made simple enough. Windows already takes up enough resources with it's own shit that we don't need to be filling in the cracks with multiples ways to such trivial things.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 11th, 2004, 9:45 pm 
Offline

Joined: May 24th, 2004, 7:45 pm
Posts: 23
Location: Bellevue, WA USA
Guest:

Maybe the script doesn't make sense to you. But the essence of tools like AutoHotkey is to personalize the user experience. Alt-Space-M may be something you know and that works well for you.

But maybe Jack prefers to use the Windows key and the cursors.

Maybe he has a programmable keypad that lets him assign single chords like Win-Up to a directional pad, in which case this solution in AutoHotkey would make perfect sense for him.

Regardless of any of these things, I appreciate seeing scripts that do interesting things even if I don't think I'll take advantage of their specific capabilities. I do learn from them, though.

_________________
Tommy


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 12th, 2004, 1:16 am 
Offline

Joined: September 2nd, 2004, 1:08 am
Posts: 124
Location: Sunnyvale
twwilliams wrote:
Guest:

Maybe the script doesn't make sense to you. But the essence of tools like AutoHotkey is to personalize the user experience. Alt-Space-M may be something you know and that works well for you.

But maybe Jack prefers to use the Windows key and the cursors.

Maybe he has a programmable keypad that lets him assign single chords like Win-Up to a directional pad, in which case this solution in AutoHotkey would make perfect sense for him.

Regardless of any of these things, I appreciate seeing scripts that do interesting things even if I don't think I'll take advantage of their specific capabilities. I do learn from them, though.


Agreed! :)

I will often see something in a script that I will use for something else. Keep 'em coming!

_________________
I am he of whom he speaks!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 12th, 2004, 3:50 am 
Offline

Joined: July 12th, 2004, 3:51 am
Posts: 51
Location: Fife,Wa
Anybody who would use profanity in a forum like this, where everyone
is actively trying to help everyone else, doesn't even need to be answered.
My $0.02
Don


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 12th, 2004, 8:01 am 
Offline

Joined: September 4th, 2004, 8:44 pm
Posts: 74
Location: UK
Quote:
Wtf happened to alt+space ~ m?


hmm. yes, if you like that one pixel at a time stuff. it's very slow. and i use a computer a lot.

but you have to do all those keystrokes and then start moving the window.

as for switching tasks, windows is ghastly. autohotkey enables me to have all my common windows on single keys. capslock gets me a file manager (and it's not Explorer!), print screen gets mail, pause gets emacs, rctrl gets web browser (and it's not IE!)...

but i reckon most people use a mouse to move a window anyway. i posted the script merely as light reading for someone who might get an idea from it, not in the expectation that i was going to change the world.


jack
dithering requires more memory


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 15th, 2004, 5:08 pm 
Offline

Joined: November 13th, 2004, 4:08 am
Posts: 2951
Location: Minnesota
For me, alt+space never made sense. For moving and resizing the window you shouldn't be pressing four different keys, the mouse will always be faster and more natural. The minimize and maximize keys should have straight hotkeys already, (think alt+f4) and alt+space is a stupid hotkey anyway. :D Anyway, great script, I'll see if I can work something like it into my alt+f4 complements script.

P.S. I refuse to dignify the guest's post with a direct response. Huey and Williams have got that covered pretty well.


Report this post
Top
 Profile  
Reply with quote  
PostPosted: November 23rd, 2004, 1:53 pm 
Liked the code, here are made some slight modifications so that the window won't run outside of the screen area.

Code:
keyboardMoveWindowIncrement=80

#Right::
   WinGetPos x, y, w, h, A   ; get coordinates of the active window
   x += %keyboardMoveWindowIncrement%
   SysGet screensize, MonitorWorkArea
   screensizeRight -= %w%
   If x > %screensizeRight%
      x= %screensizeRight%
   WinMove, A,,%x%, %y%  ; make the active window use the new coordinates
   return

#Left::
   WinGetPos x, y,,, A
   x -= %keyboardMoveWindowIncrement%
   If x < 0
      x=0
   WinMove, A,,%x%, %y%
   Return

; move active window 100 pixels up
#Up::
   WinGetPos x, y,,, A
   y -= %keyboardMoveWindowIncrement%
   If y < 0
      y=0
   WinMove, A,,%x%, %y%
   Return

; move active window 100 pixels down
#Down::
   WinGetPos x, y,w,h, A
   y += %keyboardMoveWindowIncrement%
   SysGet screensize, MonitorWorkArea
   screensizeBottom -= %h%
   if y > %screensizeBottom%
      y= %screensizeBottom%
   WinMove, A,,%x%, %y%
   Return


Report this post
Top
  
Reply with quote  
 Post subject: Very useful!
PostPosted: June 7th, 2005, 5:03 pm 
Offline

Joined: June 4th, 2005, 1:54 am
Posts: 146
This is a _very_ useful script. I use it to move windows around my multi-monitor system.

I'm actually using the origianl version, which is better suited for this. I might add some code for easily maximizing/restoring the windows using a combo of Winkey + arrows (so you don't have to move your hand too much).

If anyone wants this, drop me a note and I'll put it here when I'm done.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 29th, 2005, 1:21 pm 
Offline

Joined: June 1st, 2005, 12:36 pm
Posts: 174
Hi, I tested jack's and jtran21's scripts. jtran21's isn't working at all, but jack's is.

I like it, just have a problem: I use the setting in Windows 2000 that activates windows by just moving the mouse cursor over them - no need for clicking. When I now move a window and the mouse cursor stays at its place it will focus the next window, which will then be moved :(

Any fix for that?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 14th, 2005, 9:39 am 
Offline

Joined: June 1st, 2005, 12:36 pm
Posts: 174
Could someone/Jack perhaps add some code to it, so that the mouse cursor just would move the same distance and direction the window itself does? That should fix it! :)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 8th, 2005, 8:57 pm 
Offline

Joined: September 14th, 2005, 5:21 am
Posts: 21
Just add the MouseMove command to each hotkey -- after the WinMove command:

Code:
; for right
MouseMove, 100,0,,R

; for left
MouseMove, -100,0,,R

; for up
MouseMove, 0, -100, , R

; for down
MouseMove, 0, 100, , R


This Move-Windows code seems useful for moving windows around in a multi-monitor environment. I set mine up so that Windows-arrow keys move small increments and Windows-Control-arrow keys move larger increments.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 9th, 2005, 8:14 am 
Offline

Joined: June 1st, 2005, 12:36 pm
Posts: 174
Thanks for your ideas and comments, the script is working perfectly now, looking like this:

Code:
;2005-09-20 move active window around with Ctrl+Windows+left/right/up/down
;move active window xx pixels right
;replace # (Windows key) with ^# (Ctrl + Windows keys) if you like
#right::
   wingetpos x, y,,, A   ; get coordinates of the active window
   x += 25           ; add this distance to the x coordinate
   mousegetpos, mx, my
   winmove, A,,%x%, %y%  ; make the active window use the new coordinates
   mousemove, %mx%, %my%, 0
   return              ; finish

; move active window xx pixels left
#left::
   wingetpos x, y,,, A
   x -= 25
   mousegetpos, mx, my
   winmove, A,,%x%, %y%
   mousemove, %mx%, %my%, 0
   return

; move active window xx pixels up
#Up::
   wingetpos x, y,,, A
   y -= 25
   mousegetpos, mx, my
   winmove, A,,%x%, %y%
   mousemove, %mx%, %my%, 0
   return

; move active window xx pixels down
#Down::
   wingetpos x, y,,, A
   y += 25
   mousegetpos, mx, my
   winmove, A,,%x%, %y%
   mousemove, %mx%, %my%, 0
   return
;2005-09-20 move active window around with Ctrl+Windows+left/right/up/down


Report this post
Top
 Profile  
Reply with quote  
PostPosted: June 20th, 2007, 8:00 pm 
I need to compare design time verses run time of an application, alt+space+m+enter does not cut it. This macro, changed very easily to do +1 instead of +100, easily gets my transparent design over the run time and wouldn't you know it Oracle messed with the fonts! And not consistently either.


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Yahoo [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