Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to "verify" your details, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Entire forum
➜ MUSHclient
➜ Bug reports
➜ GetFocus without LoseFocus possible
GetFocus without LoseFocus possible
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Hve
Germany (11 posts) Bio
|
Date
| Sat 29 Jan 2005 08:24 PM (UTC) |
Message
| If a world has focus and I switch to a dialog modal (i.e. Configuration[Alt+Enter], Find[Ctrl+F], Generate Character Name[Ctrl+Alt+N], or many others), the world does not lose focus (or at least the "Loose Focus" script function is not called).
If I close that dialog, however, the "Get Focus" function *is* called.
This way, a world may get focus several times in a row without losing focus inbetween.
Also, when clicking the Help button e.g. in the Configuration dialog, LooseFocus is called.
When switching to Mushclient again (still with configuration dialog in foreground), LooseFocus is called a second time.
Closing configuration dialog causes GetFocus (once).
Suggestion:
- Technically, these dialogs should all trigger "Loose Focus" in order to have matching Get and Loose counts.
At least it should be prevented that LooseFocus or GetFocus are called twice in a row (e.g. add a flag to each world window with the info, which of these may be called next)
- It might be desireable though to neither loose nor get focus in connection with these dialogs (i.e. the get/loose functions should be called only if the change of focus goes to/from another world or to/from another application but not to some "meta" part of the mushclient application)
- combination of the above: Have a configuration option
"[x] Call Get/Loose Focus for MUSHclient dialogs" | Top |
|
Posted by
| Shadowfyr
USA (1,788 posts) Bio
|
Date
| Reply #1 on Sun 30 Jan 2005 08:11 PM (UTC) |
Message
| Well.. I suspect that this is a Windows issue, not Mushclient. I seem to remember that Windows, in some circumstances, will cause multiple focus messages, depending on what sorts of windows you go between, etc. Its confusing and somewhat inconsistent, but I am not sure Nick can fix it. | Top |
|
Posted by
| Hve
Germany (11 posts) Bio
|
Date
| Reply #2 on Tue 01 Feb 2005 06:22 AM (UTC) |
Message
| Hm, I had already imagined something like that.
What I wanted to do, was setting an away message when I'm gone and removing it when I'm back.
I'm about to make my own wrapping now like this
sub OnLooseFocus()
if (world.GetVariable("FocusAway")=0) then
world.send "away He's doing something else"
end if
world.setvariable "FocusAway",1
end sub
sub OnGetFocus()
if (world.GetVariable("FocusAway")=1) then
world.send "away"
end if
world.setvariable "FocusAway",0
end sub
In fact, I think I'll additionally use a one-shot timer in OnLooseFocus so that the away message will only be set if the world looses focus for more than a minute or so--just to avoid lot's of commands when I'm just checking for mail for a couple of seconds or so.
Thanks anayway,
Hagen
| Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
14,498 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top