ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Post New Requests Here

IDEA: Autofocus utility

(1/2) > >>

ababo:
The other day I was playing the excellent Dwarf Fortress in a window on one monitor, whilst browsing the internet on another. I found myself constantly having to switch back and forth between windows as the focus was switched whenever I used the browser window.

What I'd love to have is something where you could designate a particular window as the primary one, so that if I were to click on another window (say a link in my browser), it would automatically shift focus back to the primary window, saving me from having to play tennis with my mouse or pressing alt-tab all the time. I hope this is something that is doable!  :)

P.S. I also posted about this earlier in the General Software Discussion forum here.

belkira:
How long of a delay before it gives focus back? If you make it so it always has focus you will not be able to type anything in other windows.

A different solution for you might just be to download Tweak-UI and turn on X-Mouse, then where ever your mouse is is the area with focus.

ababo:
Well I guess what I'm after is a way to stop me from having to use the mouse so much. Say in one window all I use is the mouse to access commands, and in the other I use mainly the keyboard. I'd like the keyboard window to be the one that stays focused, so that I can type things in without worrying about having to click on it or alt-tab to it. X-mouse wouldn't be ideal as I'd still have to move the mouse back and forth between windows.

Maybe the focus time before switching back to the primary window could be something that can be set by the user, but I'm after something that will switch back quickly. Switching back as soon as I've performed a mouse click would be very handy.

belkira:
Give this a try and let me know if it does what you want. For the name of the program to keep in focus, it is case sensitive, but can be anywhere in the title. i.e. Untitled - Notepad, Notepad would work just fine for the name.


--- ---;
; AutoHotkey Version: 1.x
; Language:       English
; Platform:       Win9x/NT
; Author:         A.N.Other <[email protected]>
;
; Script Function:
; Template script (you can customize this template by editing "ShellNew\Template.ahk" in your Windows folder)
;

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
#SingleInstance, force
#Persistent
#WinActivateForce
SetTitleMatchMode, 2
Inputbox, name, Program to focus, Type the name of the program to keep in focus:, , 250, 150
if name = ; If nothing is entered for the app name exit script
{
exitapp
}
Inputbox, time, How long to wait, How long should I wait before reactivating? (milliseconds):, , 250, 150
If time =
{
time := 1000
}
SetTimer, WatchWindow, %time%
return

WatchWindow:
IfWinActive, %name%
{
return
}
Else
{
WinActivate, %name%
}
Return

ababo:
Thanks very much. That does exactly what I was looking for. :) I see it was also a pretty simple script. I'll be sure to give it a try myself next time I have an idea.

Now I can play games and browse with maximum efficiency. ;) Thanks again.

Navigation

[0] Message Index

[#] Next page

Go to full version