Nick Gammon said: I see where you are coming from, but I wonder what other plugin developers, or client users, think?
Well, I came up with the idea a long time ago, but Retnur suggested it to me just today (and I'm pretty sure he didn't know I had come up with it too). So that's two individual developers who would like to see it.
Nick Gammon said: *If a miniwindow "dialog" box was created you would want the focus - maybe - to go into an input box somewhere. So simply clicking may not be an appropriate mechanism. (You might need to command the focus to move).
If clicking is insufficient for some tasks, there's always the WindowFocus()-based alternative I suggested. The idea is to enable non-modal dialogs, though. If you want some kind of modal inputs, you can either use one of the utils.* functions or implement WindowFocus().
Nick Gammon said: *However if a dialog did pop up, and move the focus away from the command window, this might be annoying if you were half-way through typing some important command (eg. "flee").
You can already do far worse to someone's computer with plugins, and (as far as we know) nothing severe has happened. The power is there, but it's being used responsibly. This seems like a similar case: give them the tools, and let them build things. People just won't use the un-useful and/or destructive plugins.
Nick Gammon said: *You probably want <tab> to move between "input" fields - in which case it changes the current behaviour for <tab> which is to put the cursor into the command window. (And, tab-completion).
Currently, tab-completion depends on the input area having the focus anyways (which it always does), so I'm not sure that's a huge issue. If you're not typing in it, you don't expect it to be tab-completed.
As for tabbing between inputs, that's actually an excellent case for WindowFocus. I'm not sure I've ever used the "tab into command area" functionality you mention...
Nick Gammon said: *If the miniwindow happens to be not visible (eg. they have resized the output window), or if the input field (where the focus is) is not visible (perhaps it is just off the screen, or something else is on top of it) then they might be typing but not see any visible results.
That's an already-existing problem; the only difference is that it's more pronounced because you're typing, which usually has a much higher speed than clicking buttons. The best thing to do is design your miniwindow to stay on-screen, I guess. Under my proposal, it's also possible to create miniwindows that don't show any typed text at all.
Nick Gammon said: *How would you get the focus back to the command window if you needed to respond to a tell, for example? And then back to the miniwindow?
To return to the command window manually, I'd imagine you would just click it, as would now if "all typing goes to command window" disabled). To return to what you were doing in a miniwindow, that's something the author needs to handle. Probably just clicking on it would suffice again.
Nick Gammon said: *Would special sequences like tab-completion be disabled if the focus was not in the command window?
As per above, yes. Tab completion only applies to content inside the command window, unless I'm very mistaken. If there's no focus in the command window, it doesn't make sense to hit tab and have something unrelated happen. All key events (with potential exceptions?) would be directed to the hotspot event.
Nick Gammon said: *Would accelerator keys have their original meaning, or some new meaning, if the focus was not in the command window?
Good question. This is a good reason to allow for event fall-through with a false return value: the handler can filter events rather than hog them all. If the author wants to catch everything, that's their prerogative.
Nick Gammon said: *Will the next sequence in this train of thoughts lead to text boxes, with wrapping at the edge of the box, insert or overwrite modes, etc?
Probably, but that can be built on top of the basic building blocks. You could already build text-wrapping windows (and I know at least one person who already has). The only difference is that we can provide input through the keyboard now.
Nick Gammon said: *What about copy and paste? Would you expect those to be trapped so that the miniwindow could handle them?
Yes. After all, what is the user copying? The last thing they clicked, most likely. If they're taking text from the output window, it's the output window that has "focus". Likewise, "paste" has a definitive destination as well, and it's typically the last thing you clicked (or somewhere therein once you use the keyboard to navigate inside it).
Nick Gammon said: *Even if you trap Ctrl+C and Ctrl+V keystrokes, what about the menu items which do the same thing?
If a hotspot currently has "focus", it's up to the associated event handler to decide what it uses and what it lets MUSHclient deal with.
Speaking of which, I think a flag would need to be added to WindowAddHotspot in order to make the hotspot eligible for focus. It probably makes sense to have a focus callback too, so it knows when it's focused and blurred so it can animate accordingly.
Nick Gammon said: *If you hit F1 for help, will that bring up the standard output-window help, or some miniwindow-defined help?
That might be one of the keypresses you want to leave to MUSHclient. But then, you already have an "F1, F6 are macros" option in Global Preferences, so just leave it dependent on that.
Nick Gammon said: Also, what if two plugins both want to grab the focus? Which one takes priority?
I'm inclined to say "the last one to ask for it". It seems like that's how Windows works too [1].
Nick Gammon said: I can see the attraction of wanting input areas in miniwindows. But I wonder if this is turning what is basically a text client with some nice graphical widgets (eg. maps) into a fully-fledged GUI interface? And if so, will it work? Is it worth the effort?
Well, I understand if this idea is pushing MUSHclient away from what you want it to be. MUSHclient is also fifteen years old. MUDs are really fun, but the various means of playing them don't measure up to games and clients in other fields. I think this would be a good way to keep MUSHclient evolving.
[1] http://msdn.microsoft.com/en-us/library/ms646311(VS.85).aspx |