Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • September 04, 2015, 02:47:09 AM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Last post Author Topic: DONE: MiniMe (aka MaxiMe)  (Read 20340 times)

justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,896
    • View Profile
    • Donate to Member
DONE: MiniMe (aka MaxiMe)
« on: February 01, 2008, 05:09:31 AM »
I needed this quickly so whipped up this AHK script to quickly minimize or maximize windows using right shift and control. I got really frustrated with the fact there is no windows shortcut to minimize the active window. If you're like me and have many window open then consider using minimIZE to minimize windows to a small desktop thumbnail (and out of your taskbar). In combination with that, this script can make windows management a lot less painlessful.

MiniMe - latest version 4 - February 1,  2008
minimize the current window when pressing right shift twice quickly. maximize the current window when pressing right control twice quickly
v4 - permanently fixed key hold issue
v3 - added jgpaiva's key repeat fix
v2 - changed hotkeys to avoid sending keys

Code: [Select]
; minimize the current window when pressing right control twice quickly
; maximize the current window when pressing right shift twice quickly
#NoEnv
SendMode Input
#NoTrayIcon
Delay = 250

~RControl up::
If (A_PriorHotkey = A_ThisHotkey and A_TimeSincePriorHotkey < Delay)
WinMinimize, A
Return
~RShift up::
If (A_PriorHotkey = A_ThisHotkey and A_TimeSincePriorHotkey < Delay)
WinMaximize, A
Return
« Last Edit: January 28, 2009, 03:09:04 AM by justice »

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: DONE: MiniMe (aka MaxiMe)
« Reply #1 on: February 01, 2008, 05:30:19 AM »
Very interesting idea, justice!!

I never though of using this kind of repetitive hotkeys to make shortcuts.

I prefer my win+x to maximize/restore windows, though, essencially because with the scheme you chose, pgup/pgdown gets sent to the current window.
I think i'll adapt your script to work with right shift for myself :)

justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,896
    • View Profile
    • Donate to Member
Re: DONE: MiniMe (aka MaxiMe)
« Reply #2 on: February 01, 2008, 05:37:03 AM »
Ah actually I'm sure I can prevent the keys to be sent to the current window ... opening helpfile..
Yeah you can but then I have to send pagedown/up afterwards which proved a hassle,
so I changed the hotkeys as follows:

2x right control = minimize
2x right shift = maximize
« Last Edit: February 01, 2008, 05:59:47 AM by justice »

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: DONE: MiniMe (aka MaxiMe)
« Reply #3 on: February 01, 2008, 05:50:15 AM »
You can, justice.. But that'd mean you'd have to add a delay to the regular use of pageup/down (because during that time, you'd have to be waiting for the next press of pgdown), thus, the solution is really worse than the problem ;)

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: DONE: MiniMe (aka MaxiMe)
« Reply #4 on: February 01, 2008, 05:53:58 AM »
Ok, i just found a small bug. If you keep the key pressed, the keyboard auto-repeat will activate the maximize function. Not good, specially when use shift as hotkey!

jgpaiva opens ahk's help file :P

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: DONE: MiniMe (aka MaxiMe)
« Reply #5 on: February 01, 2008, 05:57:39 AM »
Ok, fixed that problem.
Code: [Select]
; minimize the current window when pressing pagedown twice quickly
; maximize the current window when pressing pageup twice quickly
#NoEnv
SendMode Input
SetKeyDelay 0,0
#NoTrayIcon
Delay = 250

~PgDn up::
If (A_PriorHotkey = A_ThisHotkey and A_TimeSincePriorHotkey < Delay)
WinMinimize, A
Return
~PgUp up::
If (A_PriorHotkey = A_ThisHotkey and A_TimeSincePriorHotkey < Delay)
WinMaximize, A
Return

Adding "up" to the hotkey will only trigger it when the key is released, fixing the keyboard repeat problem! :)

I must say congrats justice, this was a really great idea :D

justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,896
    • View Profile
    • Donate to Member
Re: DONE: MiniMe (aka MaxiMe)
« Reply #6 on: February 01, 2008, 06:01:29 AM »
Ah you made some changes :D Mind if i incorporate that? :)

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: DONE: MiniMe (aka MaxiMe)
« Reply #7 on: February 01, 2008, 06:04:43 AM »
Sure, that was the idea :)

justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,896
    • View Profile
    • Donate to Member
Re: DONE: MiniMe (aka MaxiMe)
« Reply #8 on: February 01, 2008, 06:10:51 AM »
Take out the line SetKeyDelay 0,0 as this still triggers the minimizing if you're holding the key even with your fix..
v4 coming up  :tellme: Thanks for all the help and testing. sometimes I get too excited lol  ;)
« Last Edit: February 01, 2008, 06:12:42 AM by justice »

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,219
    • View Profile
    • Coding Snacks by Lanux128
    • Donate to Member
Re: DONE: MiniMe (aka MaxiMe)
« Reply #9 on: February 01, 2008, 10:01:00 AM »
this might be moot point since you already have a working script.. :up: but just for the record, this tool, FreeSnap and its AHK equivalent by Armando can also be used for the same purpose..

Quote from: FreeSnap help file
The number-pad “Enter” key will maximize the window when it is normal size and vice-versa. The “0” key will minimizes the window.

Lashiec

  • Member
  • Joined in 2006
  • **
  • Posts: 2,374
    • View Profile
    • Donate to Member
Re: DONE: MiniMe (aka MaxiMe)
« Reply #10 on: February 01, 2008, 01:44:54 PM »
Sounds interesting. I usually don't use AutoHotkey apps (except for WinWarden), but I think I could find an use for this one. Thanks for your work! :Thmbsup:

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: DONE: MiniMe (aka MaxiMe)
« Reply #11 on: February 01, 2008, 02:43:29 PM »
And... Here's another adition:

Code: [Select]
{
    WinExist("A")
    WinGet, MaxState, MinMax,
    if(MaxState = 1)
      {
      WinRestore
      return
      }
     WinMaximize
}
If you use that instead of WinMaximize, A, you'll get a maximize toggle effect ;)

nogojoe

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 137
    • View Profile
    • Donate to Member
Re: DONE: MiniMe (aka MaxiMe)
« Reply #12 on: February 02, 2008, 03:38:28 PM »
Hi Coders

Like this idea , kinda works for me half pie. the 2x operation is great

2x right control minimizes the open window to the taskbar.

2x right shift does nothing to open the window from the taskbar  but does open when the window has been half closed via the middle button (top right toolbar ... middle button ).

Plays havoc with my program Spell Catcher Plus as it has Ctrl as its main menu/macro key .although I have changed those macro keys it still picks up the ctrl somewhere along the line and opens its window.

Is it possible to have the Scroll lock + Pause break keys  operate the actions for minimize/maximize.
I never use those keys at all on my keyboard.

I have a standard 101/102 key or Micrsoft Natural PS/2 keyboard     running Win Xp sp2

Thanks  nogojoe

Often the most convincing people are those who have lost the plot so much they don't recognize the difference between fact and fantasy

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: DONE: MiniMe (aka MaxiMe)
« Reply #13 on: February 02, 2008, 03:48:48 PM »
@nogojoe: sure, replacing those is very easy... I attached the modified script to my post.

Regarding shift press, please test this new version ;)

Code: [Select]
; minimize the current window when pressing right control twice quickly
; maximize the current window when pressing right shift twice quickly
#NoEnv
SendMode Input
#NoTrayIcon
Delay = 250

~ScrollLock up::
If (A_PriorHotkey = A_ThisHotkey and A_TimeSincePriorHotkey < Delay)
WinMinimize, A
Return
~Pause up::
If (A_PriorHotkey = A_ThisHotkey and A_TimeSincePriorHotkey < Delay)
        {
            WinExist("A")
            WinGet, MaxState, MinMax,
            if(MaxState = 1)
              {
              WinRestore
              return
              }
             WinMaximize
        }

Return

nogojoe

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 137
    • View Profile
    • Donate to Member
Re: DONE: MiniMe (aka MaxiMe)
« Reply #14 on: February 02, 2008, 05:28:59 PM »
Hi jgpaiva

Pause break works ok toogles to minimize open window to what size you want and reopens fully

Scroll lock just sends the current window straight to  the taskbar with no other action cant raise it to full open window from there,(via those keys)

Doesn’t interfere with spellcatcher plus now.

nogojoe
Often the most convincing people are those who have lost the plot so much they don't recognize the difference between fact and fantasy

willwilliams

  • Supporting Member
  • Joined in 2007
  • **
  • default avatar
  • Posts: 12
    • View Profile
    • Donate to Member
Re: DONE: MiniMe (aka MaxiMe)
« Reply #15 on: February 02, 2008, 05:53:45 PM »
Hi, FWIW, alt-spacebar, n has worked to minimise the active window, for me, since Win95.  Nice to see some quick coding solving your problem in the way you want, though.

Will

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: DONE: MiniMe (aka MaxiMe)
« Reply #16 on: February 02, 2008, 05:56:16 PM »
Scroll lock works the same way it worked before, minimizes to taskbar the active window... It does the same as pressing the minimize button, just as double-pause does the same as pressing the maximize (middle) button.

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: DONE: MiniMe (aka MaxiMe)
« Reply #17 on: February 02, 2008, 05:57:45 PM »
Hi, FWIW, alt-spacebar, n has worked to minimise the active window, for me, since Win95.  Nice to see some quick coding solving your problem in the way you want, though.

Will
That's true, but double-shift press is soo much more confortable than pressing alt+space and X.
Also, i've got alt+space reserved by the great FARR :)

nogojoe

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 137
    • View Profile
    • Donate to Member
Re: DONE: MiniMe (aka MaxiMe)
« Reply #18 on: February 02, 2008, 07:26:00 PM »
Hi, FWIW, alt-spacebar, n has worked to minimise the active window, for me, since Win95.  Nice to see some quick coding solving your problem in the way you want, though.

Will
that is true , but this way toggles from minimize to maximize --maximise to minimize using the same action 2xpause/break .

The 2x scroll lock comes in handy when you wish to get a window out of the way.
tried it with several windows open goes great

I’m liking it more and more. :Thmbsup:

What’s is the shortcut for maximizing a window from the taskbar :tellme:

nogojoe
Often the most convincing people are those who have lost the plot so much they don't recognize the difference between fact and fantasy

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: DONE: MiniMe (aka MaxiMe)
« Reply #19 on: February 02, 2008, 07:30:41 PM »
What’s is the shortcut for maximizing a window from the taskbar :tellme:
That's the problem... There isn't one :)
You have to look for the right window with alt+tab, and when you release alt+tab, it'll be restored (come out from the taskbar).

nogojoe

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 137
    • View Profile
    • Donate to Member
Re: DONE: MiniMe (aka MaxiMe)
« Reply #20 on: February 02, 2008, 08:27:07 PM »
What’s is the shortcut for maximizing a window from the taskbar :tellme:
That's the problem... There isn't one :)
You have to look for the right window with alt+tab, and when you release alt+tab, it'll be restored (come out from the taskbar).

Well you know what the next question is Can you code it with a 2x print scr :D :D
Often the most convincing people are those who have lost the plot so much they don't recognize the difference between fact and fantasy

justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,896
    • View Profile
    • Donate to Member
Re: DONE: MiniMe (aka MaxiMe)
« Reply #21 on: February 02, 2008, 08:43:47 PM »
aye you can code it to maximize the last minimized window but it would only make sense if no window is selected.. you better look at putaside.

nogojoe

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 137
    • View Profile
    • Donate to Member
Re: DONE: MiniMe (aka MaxiMe)
« Reply #22 on: February 03, 2008, 12:38:06 AM »
aye you can code it to maximize the last minimized window but it would only make sense if no window is selected.. you better look at putaside.

Thats good just what i was after.
Was running minime as well and ran into trouble with the scroll key not functioning.
As minime has 2x scroll lock as an action it kinda waylaid Putaside.

All 3 actions Minime and Putaside create would be great if they could compliment each other as there is a need for all three.
It would be great if all three could operate with the 2x key action possibly using the print screen/scroll lock/pause-break keyboard keys.
The way I see it you could have

2x print screen minimizes the window to the taskbar

2x scroll lock hides all windows and if possible 1x scroll lock does what shift/scroll does now (or maybe 3xscroll 2x scroll lock)

2x pause break toggles the window minimize maximize without sending to the taskbar.

Just my thought

nogojoe

On second thoughts the print screen/scroll lock key actions could be reversed would feel better.

Often the most convincing people are those who have lost the plot so much they don't recognize the difference between fact and fantasy

sri

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 674
    • View Profile
    • Niche Review Blogs
    • Donate to Member
Re: DONE: MiniMe (aka MaxiMe)
« Reply #23 on: February 03, 2008, 01:02:02 AM »
I guess something is wrong w/ AutoHotKey on my computer. I double clicked the .ahk file and it seems to be running, but I can't see its icon in the sys tray. When I hit Ctrl or Shift twice to minimize and maximize respectively, nothing happens.

When I double click the .ahk file a second time, it asks me whether I want to replace the running instance. But I don't see a running instance!
<a href="http://www.sridharkatakam.com">My blog</a>

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,219
    • View Profile
    • Coding Snacks by Lanux128
    • Donate to Member
Re: DONE: MiniMe (aka MaxiMe)
« Reply #24 on: February 03, 2008, 01:24:47 AM »
try updating, usually updating your Autohotkey will solve the problem.