|
GetFocus without LoseFocus possible
|
Reply to this subject
Start a new subject
 
Refresh page
| Posted by |
Hve
Germany (11 posts) bio
|
| Date |
Sat 29 Jan 2005 08:24 PM (UTC) [ quote
] |
| 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,774 posts) bio
|
| Date |
Reply #1 on Sun 30 Jan 2005 08:11 PM (UTC) [ quote
] |
| 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. |
main {
__if (Schrodinger_Cat is Alive or version >= "XP"){
____if version = "Vista" then Performance /= Number_of_Cores;
____call Functional_Code();}
__else
____call Crash_Windows();} | top |
|
| Posted by |
Hve
Germany (11 posts) bio
|
| Date |
Reply #2 on Tue 01 Feb 2005 06:22 AM (UTC) [ quote
] |
| 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.
1,777 views.
Reply to this subject
Start a new subject
 
Refresh page
top
Comments to:
Gammon Software support
Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )