Welcome Guest.   Make a donation to an author on the site July 30, 2014, 08:18:04 PM  *

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.
 
Check out and download the GOE 2007 Freeware Challenge productivity tools.
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1] 2 Next   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: (Feature Request) Arrow keys to move windows inside grid  (Read 23868 times)
ppass
Participant
*
Posts: 84

View Profile Give some DonationCredits to this forum member
« on: January 01, 2008, 07:30:20 PM »

I will summarize my request made in the Gridmove thread, just to make it easier for you to manage feature requests.

I would like to improve fast move by using arrow keys. If the current window is in zone2,then:

- Modifier + "->" key:           moves it to zone3
- Modifier + "<-" key:           moves it to zone 1
- Modifier + page-up key:      moves it to last zone
- Modifier + page-down key: moves it to zone1

Ideally, you could move the window around physically (eg if zone8 is above zone2, then Modifier + up key moves window from zone2 to zone8). But I understand that this is difficult and could be done in a 2nd step.


To achieve this, you will have to detect the position of the active window. To do that, may I suggest this simple algorithm:

  • Get the size of the active window (Top, Right, Bottom, Left)
  • Loop through all zones defined in the grid (start with zone1)
  •    If (Top == GridTop) and (Right == GridRight) and (Bottom == GridBottom) and (Left == GridLeft) then ZONE_FOUND ! ! ! get out of the loop
  •   else, go to next zone in the grid
  • Return to  beginning of loop

If you have trouble with getting the size of the active window, you may try the Windows API GetWindowRect function.
Logged
lanux128
Global Moderator
*****
Posts: 6,087



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #1 on: January 01, 2008, 07:56:57 PM »

fantastic idea, ppass! did you had FreeSnap on your mind? smiley
Logged

ppass
Participant
*
Posts: 84

View Profile Give some DonationCredits to this forum member
« Reply #2 on: January 04, 2008, 07:16:08 PM »

Thanks for the link, I did not know FreeSnap before making this suggestion. I recommend the author of GridMove to try FreeSnap, this gives the idea. Basically, it is all about pressing arrow keys and moving the active window around and resizing it.

However, I am asking something more than FreeSnap. Freesnap for one thing does not support multi monitor, and just resizes windows to the edged of the screen. Using zones like in GridMove is much more powerful and flexible. I hope that one day it will be possible to physically move windows inside GridMove (eg. "up" key moves to the zone just above the current one, etc.), then it will be very intuitive.
Logged
lanux128
Global Moderator
*****
Posts: 6,087



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #3 on: January 05, 2008, 08:21:34 PM »

yes, lack of multi-monitor support is a hindrance but i've contacted the author of FreeSnap and he replied that he is working on a new version that will include multi-monitor support. but i also believe that if GridMove incorporates this feature then all the better..
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 #4 on: January 06, 2008, 05:30:13 AM »

The reason why i don't know how to add this to gridmove is because it's not easy to detect which grid element is on the right or left of the current one. When we have a 3-part grid, or a 4 part grid, it's easy, but when we have something like the edge grid or something, things become very confusing...

Maybe this could be added as a coding snack? I don't think it'd be that hard to reproduce freesnap with ahk...
Logged

lanux128
Global Moderator
*****
Posts: 6,087



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #5 on: January 06, 2008, 07:53:40 AM »

Maybe this could be added as a coding snack? I don't think it'd be that hard to reproduce freesnap with ahk...

no, it's not that hard replicate FreeSnap's functions with AHK but since FreeSnap is already available, why not use it as some sort of internal app? e.g. those with FreeSnap already installed will get the extra features. just my 2¢..
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 #6 on: January 06, 2008, 08:49:47 AM »

What do you mean with "internal app", lanux?

I said that, because it was mentioned that it didn't have support for multi-monitor.
Logged

ppass
Participant
*
Posts: 84

View Profile Give some DonationCredits to this forum member
« Reply #7 on: January 06, 2008, 02:22:16 PM »

The reason why i don't know how to add this to gridmove is because it's not easy to detect which grid element is on the right or left of the current one. When we have a 3-part grid, or a 4 part grid, it's easy, but when we have something like the edge grid or something, things become very confusing...

Maybe this could be added as a coding snack? I don't think it'd be that hard to reproduce freesnap with ahk...

I dont know what a "coding snack" is, but defenitely Gridmove should include moving the current window with arrow keys. Please note as per my previous comment that the aim is not to reproduce FreeSnap, as Freesnap just resizes/moves windows to the edge of the screen. Here is my proposal for GridMove:

Step 1: forget about physical location of zones inside a grid. Implement a simple zone increment like this: Zone1 -> Zone2 -> Zone 3-> etc.

Step 2: include physical location.
I understand the problem that you cannot detect which zone is on the right of the current one, etc.
I suggest that you let the user parameter this for you, for each grid. Example for a 6 zone grid:

horizontal arrows (user defined per grid):  Zone1 -> Zone2 -> Zone4 -> Zone5 -> Zone6 -> Zone3
Example: if the current zone is Zone1 and you hit the left arrow, the window should be moved to Zone3 of the grid.

vertical arrows (user defined per grid): Zone1 -> Zone4 -> Zone6 -> Zone3 -> Zone2 -> Zone5
Example: if the current zone is Zone4 and you hit the up arrow, the window should be moved to Zone6 of the grid.


My understanding was that you are willing to implement step1 and are waiting to have some time available to code this. Could you confirm this?

Once step1 is coded, step2 with this proposal should be a small step further ahead.
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 #8 on: January 06, 2008, 05:21:33 PM »

Ok,i added the "step 1" you mentioned (actually, it's pretty fun! Not sure if it's that useful, though).

To use it, download gridmove, run once, then edit the .ini file and replace the '0' on the SequentialMove key with a '1' and reload gridmove.
Then, to cycle grid elements, press win + right/left.

Regarding the step2, it'd have to be made in the following way: each grid element would say what was the grid on its right, the grid on its left and the grid on its top and bottom. I think it'd be quite a chore to implement and then to create grids with these features, though.
Logged

Armando
Charter Member
***
Posts: 2,674



see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #9 on: January 06, 2008, 05:53:46 PM »

Hummm... I just installed the new version, and Gridmove consumes a lot of CPU power for about 1.5 min, right after launching or reloading, and then it calms down. Anybody experiences such a thing ?

BTW, the cycling works well.  Thmbsup
Like you jpaiva, I'm not sure how useful that will be but it's another tool... Who knows...

Right now the hotkeys are :

CommandHotkey=#g
FastMoveModifiers=#

Could I change them to (because they conflict with FreeSnap's own hotkeys):

CommandHotkey=+^#g
FastMoveModifiers=+^#

I tried, but it didn,t seem to work...

And should that parameter have a value :

FastMoveMeta=

Thanks !  smiley
Logged

"I suppose it can be said that I'm an absent-minded driver. It's true that I've driven through a number of red lights on occasion, but on the other hand, I've stopped at a lot of green ones but never gotten credit for it."
Glenn Gould
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 #10 on: January 06, 2008, 06:05:07 PM »

Armando could you please send my your ini file?

Those 2 keys can be changed in the hotkeys -> command hotkey and hotkeys -> fast move modifiers.

The FastMoveMeta is supposed to be without value by default. It was added in this version. It allows you to move the windows to grids 11->20 in a similar way to pressing win+#. You press win+<fastmovemeta> and then press a # and the window it moved to grid 10 + #. (is that understandable? Sad )
Logged

Armando
Charter Member
***
Posts: 2,674



see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #11 on: January 06, 2008, 07:00:17 PM »

thanks jgpaiva.

i'll send you my ini file right away, before I make any changes to it.


* GridMove.exe.ini (0.52 KB - downloaded 282 times.)
Logged

"I suppose it can be said that I'm an absent-minded driver. It's true that I've driven through a number of red lights on occasion, but on the other hand, I've stopped at a lot of green ones but never gotten credit for it."
Glenn Gould
lanux128
Global Moderator
*****
Posts: 6,087



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #12 on: January 06, 2008, 07:05:22 PM »

What do you mean with "internal app", lanux?

I said that, because it was mentioned that it didn't have support for multi-monitor.

my bad, i meant to quote ppass but then again, FreeSnap lacks multi-monitor support so it moot point..
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 #13 on: January 06, 2008, 07:12:25 PM »

I just tested your ini file, and it's all right. Maybe we should deal with this in PM, to avoid spamming the forum, ok?
Logged

ppass
Participant
*
Posts: 84

View Profile Give some DonationCredits to this forum member
« Reply #14 on: January 06, 2008, 08:58:54 PM »

Ok,i added the "step 1" you mentioned (actually, it's pretty fun! Not sure if it's that useful, though).

Thank you so much for such a responsive attitude! It works exactly as expected. I find it pretty useful, especially since consecutive zone numbers match zones that are actually close one to the other in my grids.

Congratualtions on implementing detection of which grid element the active window is. This works perfectly!



Regarding the step2, it'd have to be made in the following way: each grid element would say what was the grid on its right, the grid on its left and the grid on its top and bottom. I think it'd be quite a chore to implement and then to create grids with these features, though.


That is pretty straight forward, the user just has to define 2 strings per grid as explained in my previous post:

horizontal arrows: (1,2,4,5,6,3)
This means that the user considers zone2 to have zone4 on its right and zone1 on its left

vertical arrows: (1,4,6,3,2,5)
This means that the user considers zone2 to have zone3 below and zone5 below

For example, for a 4 part grid, you'd have horizontal arrows = (1,2,3,4) and vertical arrows = (1,3,2,4). Believe me, defining this for the user is not a chore, it is just a small string.

On the program side, you just have to parse this simple string or dump it to an array, and assign the new zone to:

- the previous element of "horizontal arrows" in case the left  key was pressed
- the next      element of "horizontal arrows" in case the right key was pressed
- the first       element of "horizontal arrows" in case the "Home" key was pressed
- the last       element of "horizontal arrows" in case the "End"  key was pressed

- the previous element of "vertical arrows" in case the down  key was pressed
- the next      element of "vertical arrows" in case the up key was pressed
- the first       element of "vertical arrows" in case the "Page Down" key was pressed
- the last       element of "vertical arrows" in case the "Page Up"  key was pressed

At least for the simple grids, arrow navigation should feel pretty natural.
Logged
ppass
Participant
*
Posts: 84

View Profile Give some DonationCredits to this forum member
« Reply #15 on: January 07, 2008, 01:10:59 AM »

For step1, could you correct a couple of glitches:

- When a window is not recognised as inside a grid element, "No Match for Grid" pops up once if right key is pressed and once if left key is pressed. Could you make this only one popup?

- When one grid element is out of bounds of the visible screen, GridMove returns "No Match for Grid", although the window is inside a grid element. This may be because when you check the position of the current window, the value returned might not be the actual position, it could be cut to the limits of the visible screen?

Example: try this simple 2 zone-grid on a single monitor (I use this to cut/hide the top 10% of a window). When the active window is in zone2 with its top 10% hidden, GridMove fails to detect and returns "No Match for Grid"

[Groups]

NumberOfGroups = 2

[1]
  TriggerTop   = [Monitor1Top]
  TriggerLeft  = [Monitor1Left]
  TriggerBottom= [Monitor1Bottom]
  TriggerRight = [Monitor1Left] + [Monitor1Width] 
  GridTop   = [Monitor1Top]
  GridLeft  = [Monitor1Left]
  GridBottom= [Monitor1Bottom]
  GridRight = [Monitor1Left] + [Monitor1Width]
[2]
  TriggerTop   = [Monitor1Top] - 0.1 *([Monitor1Bottom]-[Monitor1Top])
  TriggerLeft  = [Monitor1Left]
  TriggerBottom= [Monitor1Bottom]
  TriggerRight = [Monitor1Left] + [Monitor1Width] 
  GridTop   = [Monitor1Top] - 0.1 *([Monitor1Bottom]-[Monitor1Top])
  GridLeft  = [Monitor1Left]
  GridBottom= [Monitor1Bottom]
  GridRight = [Monitor1Left] + [Monitor1Width]

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 #16 on: January 07, 2008, 05:37:08 AM »

Ok, i fixed the issue you mentioned in this previous post and uploaded the new version. (notice that i didn't update the DCupdater file, so, to download it from dcupdater, press "install update from the web")

- When a window is not recognised as inside a grid element, "No Match for Grid" pops up once if right key is pressed and once if left key is pressed. Could you make this only one popup?
"no match for grid" pops up everytime the program tries to match that window agains the grid and can't find any match. I can't understand why you'd press right and then left, if it fails on right, it'll fail on left too as they both use the same mechanism..

Your idea on how to implement the horizontal/vertical cycle realy simplifies things, and maybe it really is the simplest way to implement it. I'll give it some thought.
Logged

Armando
Charter Member
***
Posts: 2,674



see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #17 on: January 07, 2008, 11:24:55 AM »

no, it's not that hard replicate FreeSnap's functions with AHK but since FreeSnap is already available, why not use it as some sort of internal app? e.g. those with FreeSnap already installed will get the extra features. just my 2¢..

(This might be a bit off topic, but since the discussion started here... But I can move it if you want.)

Actually, I think that cloning freesnap with AHK would be a good idea : freesnap is pretty inflexible : can't really change the hotkeys, which is annoying since it monopolizes a bunch of keys, some I never use (Windows Key + I, Windows Key + K Windows Key + J, etc. because they’re not convenient for me)

So, inspired by your Winmanagement Script, jpaiva, I "cloned" freesnap  tongue. There are  certain missing features : there is no undo (it would be complex for me to do that…  BUt if you can explain me how to do it, I’ll add it) , and no incremental window resizing... I could add that eventually (with the combination of Win  + or - keys). So I could post it here if you want.

Of course, shortcut keys can be changed to one's liking by modifying the script!
« Last Edit: January 07, 2008, 11:26:32 AM by Armando » Logged

"I suppose it can be said that I'm an absent-minded driver. It's true that I've driven through a number of red lights on occasion, but on the other hand, I've stopped at a lot of green ones but never gotten credit for it."
Glenn Gould
painz
Participant
*
Posts: 9


View Profile Give some DonationCredits to this forum member
« Reply #18 on: January 07, 2008, 04:10:17 PM »

Thanks, it's almost perfect now.
Although, is it possible to suppress 'no match for grid' message and just cycle grids from #1 instead? I dont use very large grid and its perfectly fine to browse possible locations.
Also is it possible to redefine WIN key or should I redefine hotkeys for winAmp instead? (my winamp uses win+arrows too)
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 #19 on: January 07, 2008, 06:57:52 PM »

You're right, when it doesn't find a match, it should just move to the first grid instead.

As for redifining the hotkeys, i'll have it use the same modifier as fastmove.

Ok, new update to incorporate the above changes, and also corrected an error with the connection with DCUpdater.

Regarding step 2 of "cycle grid elements", i know exactly how to do it, but i'll have to wait for some time to implement it since it involves quite a few changes to the way gridmove works.
Logged

Armando
Charter Member
***
Posts: 2,674



see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #20 on: January 07, 2008, 07:32:03 PM »

(my winamp uses win+arrows too)

I've remapped WinAmp hotkeys to ctrl+Alt+arrows. Fairly intuitive combination, I find.
Logged

"I suppose it can be said that I'm an absent-minded driver. It's true that I've driven through a number of red lights on occasion, but on the other hand, I've stopped at a lot of green ones but never gotten credit for it."
Glenn Gould
ppass
Participant
*
Posts: 84

View Profile Give some DonationCredits to this forum member
« Reply #21 on: January 07, 2008, 10:45:21 PM »

"no match for grid" pops up everytime the program tries to match that window agains the grid and can't find any match. I can't understand why you'd press right and then left, if it fails on right, it'll fail on left too as they both use the same mechanism..

Now that you have suppressed the "No match for grid" popup, this discussion is of no avail any more.



I found one small bug with the latest version 1.19.49. I tried it with my simple 2 zone-grid presented above. Right arrow works, but the window remains stuck when the left arrow is pressed when the window has its top 10% hidden. Maybe a small bug in your code...


Regarding step 2 of "cycle grid elements", i know exactly how to do it, but i'll have to wait for some time to implement it since it involves quite a few changes to the way gridmove works.

 cheesy I hope those are not too painful changes for you (anyway, you have made the hardest part already with step1). Looking forward to step2 !
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 #22 on: January 08, 2008, 05:03:45 AM »

I found one small bug with the latest version 1.19.49. I tried it with my simple 2 zone-grid presented above. Right arrow works, but the window remains stuck when the left arrow is pressed when the window has its top 10% hidden. Maybe a small bug in your code...
Actually, the problem is a little different. Some windows don't resize to larger sizes than the screen. (windows explorer is a good example.) Thus, When you try to resize them using that second grid element, they don't get the correct size, and don't get identified as being in grid 2 when you press win+left. If you try that with a window that does resize to a size larger than the screen (which is very rare, from what i can see), you'll notice that it does work as expected.
Logged

painz
Participant
*
Posts: 9


View Profile Give some DonationCredits to this forum member
« Reply #23 on: January 08, 2008, 06:57:49 PM »

It's really good but question again - is it possible to somehow skip grids on win-arrrows? I use grid with WindowOnTop area and when window gots to it it just shrink uncontrollably. And #2 is it possible to inject additional pseudo-selector which will autosave and restore position/size we began with? And maybe actually remap win key? Thank you.
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 #24 on: January 08, 2008, 07:13:56 PM »

It's really good but question again - is it possible to somehow skip grids on win-arrrows? I use grid with WindowOnTop area and when window gots to it it just shrink uncontrollably.
That wasn't supposed to happen, it should only cicle through grid elements that move the window, not special grid elements like "run", "alwaysontop" and such... Are you sure that's happening with the latest version? (V 1.19.50)

And #2 is it possible to inject additional pseudo-selector which will autosave and restore position/size we began with?
Sorry, i don't understand what you mean.

And maybe actually remap win key? Thank you.
That already can be done, just change the modifier of "fastmove", as it uses the same one.
Logged

Pages: [1] 2 Next   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.053s | Server load: 0.11 ]