ID:149681
 
Is there a way to move the "focus" from the browser window to the command line? (It's irritating for a user to have to keep clicking on the command line after every time I browse() something to them.) I couldn't find anything in the reference.

Aha, found an old quote from Tom:

<>

Some suggestions... could you implement a toggle that would allow a coder to make the focus jump to the command line all the time? Like client.command_focus = 1. Another idea would be to have TAB not only move among fields on a page but to the command line too. Not sure if that's possible.

Z

Z</<believe>
Zilal wrote:
Is there a way to move the "focus" from the browser window to the command line? (It's irritating for a user to have to keep clicking on the command line after every time I browse() something to them.) I couldn't find anything in the reference.

I can't think of one. But why is it needed? Unless there is a bug, calling browse() shouldn't disrupt the command-line. The focus should only change if the user clicks on the browser to edit a form or what-not, and in those cases I think it's the right behavior. Am I missing something?
In response to Tom
If using MFC focuses and order are assigned on the application layout.

LJR
Zilal wrote:
Is there a way to move the "focus" from the browser window to the command line? (It's irritating for a user to have to keep clicking on the command line after every time I browse() something to them.) I couldn't find anything in the reference.

With the nifty new browser features, it's a snap! Just popup a browser window and immediately clear it. You may notice the new browser popup flicker, but it's better than being stuck on the browser window unexpectantly.

client/proc/command_focus()
src << browse(" ","window=clearfocus;size=1x1") // make a browser window
//clear the browser window, giving focus to the BYOND client
src << browse(null,"window=clearfocus")

You can even use it to remove focus from annoying alert boxes. ;)

proc/passive_alert(Usr = usr, Message, Title, Button1 = "Ok", Button2, Button3)
var/client/Client
if(ismob(Usr)) Client = Usr:client
if(istype(Usr,/client)) Client = Usr
if(Client)
spawn(-1) // new program thread with no delay
alert(Usr,Message,Title,Button1,Button2,Button3)
Client.command_focus()

In response to Tom
Tom wrote:
I can't think of one. But why is it needed? Unless there is a bug, calling browse() shouldn't disrupt the command-line. The focus should only change if the user clicks on the browser to edit a form or what-not, and in those cases I think it's the right behavior. Am I missing something?

In my case, the user clicks a link in the browser, and the link calls browse(). But right after that they need to do things with the keys, and the keys don't work! It's not the end of the world to have to click the command line, but it is an annoyance.

Z