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 

Incrementally switch between windows
Goto page Previous  1, 2, 3, 4, 5 ... 9, 10, 11  Next
 
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
mo



Joined: 16 May 2004
Posts: 7
Location: Seattle

PostPosted: Sun Jan 02, 2005 1:27 am    Post subject: remapped up/down Reply with quote

thanks alot for posting your awesome script. I mapped up/down (and pgup/pgdn) to ctl-p and ctl-n, so you can go up and down without my hands leaving home row.

Having each application name (or shortened app name) first before window title in the window list could be nice.

thanks again.
Back to top
View user's profile Send private message
keyboardfreak



Joined: 09 Oct 2004
Posts: 216
Location: Budapest, Hungary

PostPosted: Sun Jan 02, 2005 3:13 pm    Post subject: Reply with quote

An update for the new year:

  • The currently selected window can also be activated with a double click. Mouse users can change the activation key to a mouse button (e.g. middle button) and this way the switcher can be operated with the mouse only.
  • The switcher window can be moved horizontally with the left/right arrow keys if it blocks the view of windows under it. If you hold the arrow key down instead of pressing it several times the current selection changes in the listbox. I think it's a limitation of AutoHotkey (but Chris is the authority in this question), because the script cannot move the window fast enough and the arrow key presses reach the listbox while the result of the previous Input command is being processed. It's not a big deal, I usually press the right/left arrow key 2-3 times. There is no need to hold it down.

Edit: See the latest version of the script in the first post.


Last edited by keyboardfreak on Fri Jan 07, 2005 6:54 pm; edited 1 time in total
Back to top
View user's profile Send private message
keyboardfreak



Joined: 09 Oct 2004
Posts: 216
Location: Budapest, Hungary

PostPosted: Sun Jan 02, 2005 3:15 pm    Post subject: Re: remapped up/down Reply with quote

mo wrote:
Having each application name (or shortened app name) first before window title in the window list could be nice.

Good idea, though I don't know if it is possible to get the actual name of the application. Anyone?

Window class is not always good, the name of the executable can also be misleading. Is there an other method?
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10716

PostPosted: Sun Jan 02, 2005 9:05 pm    Post subject: Reply with quote

keyboardfreak wrote:
If you hold the arrow key down instead of pressing it several times the current selection changes in the listbox. I think it's a limitation of AutoHotkey
I think this is most likely caused by SetWinDelay being at it's default of 100ms. Try decreasing it to -1 right before the move (you can restore it later if you need the former value).

If that doesn't solve it, I'd like to work with you more to find out the cause.

Quote:
I don't know if it is possible to get the actual name of the application
You can get the process name of a window with "WinGet, OutputVar, ProcessName, WinTitle". This might be a relatively slow operation, which is probably only of concern if you call it dozens of times consecutively.
Back to top
View user's profile Send private message Send e-mail
keyboardfreak



Joined: 09 Oct 2004
Posts: 216
Location: Budapest, Hungary

PostPosted: Mon Jan 03, 2005 5:07 pm    Post subject: Reply with quote

Chris wrote:
I think this is most likely caused by SetWinDelay being at it's default of 100ms. Try decreasing it to -1 right before the move (you can restore it later if you need the former value).

Setting win delay to -1 solved the problem. It works nicely. Thanks.
Back to top
View user's profile Send private message
keyboardfreak



Joined: 09 Oct 2004
Posts: 216
Location: Budapest, Hungary

PostPosted: Mon Jan 03, 2005 5:20 pm    Post subject: Reply with quote

Chris wrote:
keyboardfreak wrote:
I don't know if it is possible to get the actual name of the application
You can get the process name of a window with "WinGet, OutputVar, ProcessName, WinTitle". This might be a relatively slow operation, which is probably only of concern if you call it dozens of times consecutively.

It seems to return the name of the executable (e.g. wincmd32.exe) which is suitable if there is no other alternative.

I wonder if there is a method to retrieve the human readable name of an application (if it's registered somewhere). For example: "Windows Commander" instead of "wincmd32.exe".
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10716

PostPosted: Mon Jan 03, 2005 11:43 pm    Post subject: Reply with quote

keyboardfreak wrote:
I wonder if there is a method to retrieve the human readable name of an application (if it's registered somewhere). For example: "Windows Commander" instead of "wincmd32.exe".
I don't recall seeing anything thing like that offered by any of the OS API calls.
Back to top
View user's profile Send private message Send e-mail
JSLover



Joined: 20 Dec 2004
Posts: 634
Location: LooseChange911.com The WTC bldgs shouldn't have fallen that fast. The official story is a lie!

PostPosted: Tue Jan 04, 2005 11:19 am    Post subject: Reply with quote

Chris wrote:
keyboardfreak wrote:
I wonder if there is a method to retrieve the human readable name of an application (if it's registered somewhere). For example: "Windows Commander" instead of "wincmd32.exe".
I don't recall seeing anything thing like that offered by any of the OS API calls.

...I didn't read this entire thread, but if wincmd32.exe has a version resource, can't AHK read that?...hrm, I guess it can't, FileGetVersion only gets the version number or something, perhaps a new command...

Code:
FileGetVersionInfo, OutputVar, Property, Filename

...property being any string on the left side of the version tab (dynamic, not limited to normal properties) & also the special properties, like description, that aren't in the list, it should retrieve the text at the top next to "Description:". It should support the real name of the property (as specified in the version resource before being compiled) "ProductName" as well as the display (pretty) name "Product Name" (at least for the normal properties). Hrm, with creative use of...

Code:
Run, properties wincmd32.exe, , hide

...you could open the properties window, switch to the version tab & get the text, it would be a little difficult cuz run can't give you an hwnd (ahk_id) for the window you just created, just a pid. & even with an hwnd, you can't easily operate on hidden windows (without having to turn on DetectHiddenWindows & get any slowdowns involved with it, if any).
_________________

Home • Click image! • Blog
Back to top
View user's profile Send private message Visit poster's website
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10716

PostPosted: Tue Jan 04, 2005 8:28 pm    Post subject: Reply with quote

I've added your ideas to the informal to-do list. Thanks.
Back to top
View user's profile Send private message Send e-mail
keyboardfreak



Joined: 09 Oct 2004
Posts: 216
Location: Budapest, Hungary

PostPosted: Thu Jan 06, 2005 5:20 pm    Post subject: Reply with quote

Changes:

  • Fixed unwanted selection change when the switcher window is moved horizontally with the arrow keys. Thanks Chris!
  • Added required AutoHotkey version
  • Added option to show the process name before the window title. The extension (.EXE) is trimmed from the process name. The width of the switcher window has been increased a bit, so that the titles are visible when this option is enabled.

    Thanks to mo for the idea.

Edit: See the latest version of the script in the first post.


Last edited by keyboardfreak on Fri Jan 07, 2005 6:55 pm; edited 1 time in total
Back to top
View user's profile Send private message
jonny



Joined: 13 Nov 2004
Posts: 2951
Location: Minnesota

PostPosted: Fri Jan 07, 2005 1:52 am    Post subject: Reply with quote

Idea for KF: Instead of punishing our vertical scroll bars on every page, perhaps you could simply edit your post on the first page? Great progress on it, by the way. I use this a lot.
Back to top
View user's profile Send private message
keyboardfreak



Joined: 09 Oct 2004
Posts: 216
Location: Budapest, Hungary

PostPosted: Fri Jan 07, 2005 6:07 am    Post subject: Reply with quote

jonny wrote:
Instead of punishing our vertical scroll bars on every page, perhaps you could simply edit your post on the first page?

This issue came up before, here's my answer again:
Quote:
Sorry about posting the script that many times in different posts. It would have been more practical to update the script code in my first post, but it didn't occur to me then and now I don't want to mix up the topic by making changes to previous posts.

It might even be instructive to some to see who a script develops from the first idea to a more mature version.

So you're perfectly right, this would be the correct way to do it, but I'm too lazy to edit all my previous posts. No one pays me to do it, I work on the switcher only when I feel like it, so I usually put off working on the boring bits. Wink
Back to top
View user's profile Send private message
keyboardfreak



Joined: 09 Oct 2004
Posts: 216
Location: Budapest, Hungary

PostPosted: Fri Jan 07, 2005 6:13 am    Post subject: Reply with quote

I'll try to overcome my lazyness and do it in the next update.
Back to top
View user's profile Send private message
jonny



Joined: 13 Nov 2004
Posts: 2951
Location: Minnesota

PostPosted: Fri Jan 07, 2005 6:21 am    Post subject: Reply with quote

Well... why not simply start a new thread? No editing necessary, everyone can still follow the original development process, and the problem is solved! (May want to rename the original post to avoid confusion)
Back to top
View user's profile Send private message
keyboardfreak



Joined: 09 Oct 2004
Posts: 216
Location: Budapest, Hungary

PostPosted: Fri Jan 07, 2005 6:29 am    Post subject: Reply with quote

jonny wrote:
Well... why not simply start a new thread? No editing necessary, everyone can still follow the original development process, and the problem is solved!

Well, the reference to the development process was only a pretext on my part to justify my lazyness. Smile I don't think people are really interested in it, they probably want to use the latest version and that's it, so I really should do the cleanup sometime.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page Previous  1, 2, 3, 4, 5 ... 9, 10, 11  Next
Page 4 of 11

 
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