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 

two things

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List
View previous topic :: View next topic  
Author Message
savage



Joined: 02 Jul 2004
Posts: 206

PostPosted: Sat Jul 03, 2004 12:06 am    Post subject: two things Reply with quote

I've been using AHK for a while now and found it to be one of the most useful programs I've ever found for windows, alongside Litestep, Powerpro, and Directory Opus. I've got to little requests though.

First, and I think this has been discussed before, could there be an option to catch non-character keys in Input? Similarly, when we get hotstring support, could the same be true for that? I think I brought this up before I registered, but that would make it really easy to set up something swank like emacs-style keychains. I think they really add to the number of things you can bind to the keyboard (after all there's only so many practical hotkeys).

Maybe you could define a hotstring (though I guess they wouldn't be all that different from normal hotkeys now) like so:

:^X^C::Send, !{F4}

The second thing I'd like to see is an option for WinActivate to not raise the window to the foreground. Windows, X-Mouse behavior is nice, but it switches to the desktop, which X doesn't do. I wrote a little ahk script to do X-Mouse and ignore the desktop, but it raises the window, which basically just sucks Razz.


On a side note, I'd like to say that AHK's simple syntax is a real boon for tossing together spur of the moment things to make life easier. It just takes a moment with window spy and an editor to quicken all sorts of things. Thanks!
Back to top
View user's profile Send private message AIM Address
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10464

PostPosted: Sat Jul 03, 2004 2:09 am    Post subject: Reply with quote

Quote:
an option to catch non-character keys in Input

You probably know that you can simulate that behavior by making the prefix key into a hotkey and then having the subroutine do an Input. In your example, that would allow the first key to be ^x but the second would have to be a printable character. But you could go further and have the ^x subroutine use the Hotkey command to temporarily enable the ^c hotkey (perhaps on a 3000ms timer that later disables it if you wind up never pressing the key). That's a lot of work though; clearly the ability to catch non-char keys would be better, so I'll make a note to try to put this into Input and upcoming hot strings feature.

Quote:
an option for WinActivate to not raise the window to the foreground

This seems to work. I didn't find any other way to do this except possibly WinShow(...SHOW_NOACTIVATE...) which I didn't test:
Code:
Run, calc
WinWaitActive, Calculator
Send, !{tab}
WinWaitNotActive
Sleep, 500
WinSet, AlwaysOnTop, On  ; Bring to foreground without activating.
WinSet, AlwaysOnTop, Off
Back to top
View user's profile Send private message Send e-mail
savage



Joined: 02 Jul 2004
Posts: 206

PostPosted: Sat Jul 03, 2004 7:17 pm    Post subject: Reply with quote

I couldn't get that method for not raising windows to work. I'm trying to figure this out with messages, but I'm not having any luck. If I send wm_activate or wm_setfocus to the window under the mouse it basically freaks everything out.
Back to top
View user's profile Send private message AIM Address
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10464

PostPosted: Sat Jul 03, 2004 8:38 pm    Post subject: Reply with quote

Quote:
The second thing I'd like to see is an option for WinActivate to not raise the window to the foreground.

I think the problem is that I misunderstood the above. I thought you wanted to bring a window on top of other windows without actually activating it.

Perhaps you can clarify what you mean. FYI, I believe it is impossible in a Windows OS for any control to have focus unless its parent window is the foreground/active window.
Back to top
View user's profile Send private message Send e-mail
savage



Joined: 02 Jul 2004
Posts: 206

PostPosted: Sun Jul 04, 2004 6:27 pm    Post subject: Reply with quote

If you turn on XMouse in tweak UI (or manually), when you move the mouse over a window, it activates and gets focus but doesn't come to the front like it normally does. The problem with this in windows is that when the mouse is in the desktop it gets the focus. In X the sloppy focus ignores the background. I'm tring to duplicate this effect, ie to activate a window without bringing it to the foreground. By doing this in AHK rather than just using X-mouse, I'll have more control over what windows this affects.
Back to top
View user's profile Send private message AIM Address
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10464

PostPosted: Sun Jul 04, 2004 10:43 pm    Post subject: Reply with quote

I understand what you mean now, and I tried TweakUI and saw the effect. It seems that this effect is achieved by a global system change known as SPI_SETACTIVEWINDOWTRACKING. This message is broadcast to all windows whenever you change the setting in TweakUI.

I do not think there is an easy way to achieve this effect on a specific window. It might be impossible if it's a low-level, global feature in the OS.

The problem lies in the fact that SetForegroundWindow() is the only call I know of to give the keyboard focus to a window of a *different* app. And that call always brings the window to the top as a side-effect.

It might be possible to save the window's z-order position, activate it, then put back its original order (hopefully retaining its status as being active). However, I'm doubtful that even this would work and if it did, there would almost certainly be an unwanted flashing/redrawing effect when it happened since the target window would be momentarily on top of other windows before it was put behind them again.

If there were an easy way, I'd add it to the WinSet command. However, the odds seem to be against it. If it's important, I'll make a note to experiment with it.
Back to top
View user's profile Send private message Send e-mail
savage



Joined: 02 Jul 2004
Posts: 206

PostPosted: Tue Jul 06, 2004 1:57 am    Post subject: Reply with quote

I figured it was a lower level thing. Oh well, don't worry to much about it, I really wanted it to switch easily between console windows, but I set up a window group for them, and that really works a lot better.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List All times are GMT
Page 1 of 1

 
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