Messages - tranglos [ switch to compact view ]

Pages: prev1 ... 204 205 206 207 208 [209] 210 211 212 213next
1041
General Software Discussion / Re: How do you expect macros to behave?
« on: February 11, 2007, 03:31 PM »
Thanks, mouser. The reason I'm asking is because I'm trying to find the "least astonishing" behavior, and in this case it's not obvious to me. There is of course a story behind the question. I have a fairly complex command execution engine for KeyNote. It has a UI builder on one side, which lets you tear down the default menus and toolbars, all of them, and create your own from scratch. (Allowing only one menu to be customized makes little sense, because the mechanism required to run it is exactly the same as the mechanism that allows you unlimited customization.) Another part of the scheme is a macro engine, which records and replays commands and, yes, persists them as scripts that you can easily edit.

Basically, commands have required and optional parameters. The optional parameters fill in default values, while required params must be given explicitly. So for example, a File|Open command looks like this in a menu configuration file:
<menuitem command="fileOpen" />

When this is triggered, the engine finds that the required "filename" argument is missing, and finds a handler for the command that gets the filename (e.g. by putting up a dialog box). The command also has an optional "readOnly" parameter, which defaults to false. What this lets you do is add a menu item like this:
<menuitem command="fileOpen" fileName="c:\somefile.txt" readOnly="true"/>

In short, you can put a mini-macro right in the menu. This, I hope, would be useful for things like commonly used font styles, etc - instead of going through a dialog box every time, you can add a custom menuitem that defines all the style settings. When you do so, you can specify whatever parameters you need, and the engiine will either fill in missing optional params, or prompt you for the missing required ones.

But once you have this, you need to figure out how much information to store when recording a macro the "normal" way, for replaying. For each command I can either store just the command itself (which would require user action on replaying, if the command has any required parameters), or I can store some/all of the actual parameters used for the command.

I agree with you about seeing what it does and tweaking the scripts manually, but most people won't go as far. For them, I need to provide the most useful behavior out of the box.

On edit: And you will be able to have a three-way toggle :) <bold/> by itself would toggle, and then there's <bold on="true"/> and <bold on="false"/> to force it either way. I'm sinplifying the syntax here, but just to give the idea.

marek

1042
General Software Discussion / How do you expect macros to behave?
« on: February 11, 2007, 08:37 AM »
Joel Spolsky says in one of his essays:
A user interface is well-designed when the program behaves exactly how the user thought it would.

It's also been called principle of least astonishmentw. So here's something that's been puzzling me for a long while: the behavior of macros. Leaving aside how macros work in popular software like Word, how do you expect macros to behave in these three situations?

1. While recording a macro, you use Edit|Paste. What should happen when replaying the macro?
a) the macro should insert the same exact text that got inserted by Paste when recording.
b) the macro should insert current clipboard contents (or nothing if the clipboard is empty)

2. While recording a macro, you use the File|Save As command and specify a new name for the document. What should happen when replaying the macro?
a) the current document should be saved using the same filename that was specified while recording (possibly overwriting an existing file)
b) the macro should display the "Save As" dialog box, letting you specify a name, just as if you clicked File|Save As manually.

3. While recording a macro you select some text and click Format|Bold. The text was using normal style before, so now it is bold. What should happen when replaying the macro?
a) regardless of whether current selection is bold or not, the macro should make the text bold (leave it bold if it was bold already)
b) the effect should be the same as manually clicking Format|Bold: if text was normal, make it bold; if text was already bold, make it normal.

There is no perfect solution, of course. Each a and b choice has its downsides. Number 3 is especially bothersome for me, because it's very common to have this kind of toggle, and I can't decide which behavior is more useful or more "natural".

All (a) choices are "do exectly what happened while recording", while all (b) choices are "do what would happen if the command was invoked manually in the current document". So what is your preference? Straight As, straight Bs, or some combination?

marek

1043
Living Room / Re: What is the most useless key on the keyboard
« on: February 10, 2007, 02:21 PM »
But, I would have to say that the "right-click" key is the most unused key on my keyboard.

The other two that are right up there are right-ctrl and right-alt, in that order.

All this goes to show is that no keys should ever be removed, ever :)

I love the right-click key, because it gives me the context menu without using the mouse. Shift+F10 should also do that, but many programs ignore it or override with other functionality.

Right ctrl is awfully useful for clipboard and navigation actions with home/end/insert/delete keys. And without right alt you couldn't type national characters in any non-Western language. Right Alt (sometimes called AltGr, for "alternate graphic") adds all the twiggly tails and accent marks to latin characters. I couldn't type in Polish at all without right alt.

On edit: Wikipedia has a whole article on AltGr, quite informative too: http://en.wikipedia.org/wiki/Altgr

1044
Living Room / Re: What is the most useless key on the keyboard
« on: February 10, 2007, 02:15 PM »
I've voted Scroll Lock, because very few programs use it anymore. But it does have a useful function - when engaged, you should be able to scroll any window without moving the caret. It still works in Excel 2003, but has been mostly forgotten by programmers today. It's great when you want to scroll to see something in a document but don't want to lose your current position. It's more or less the same as scrolling with the wheel without ever clicking the document anywhere.

Other than that, I'd vote for Pause/Break, which has absolutely no purpose in a multitasking OS, but now that I'm using mouser's Find and Run Robot, the Break key is back in action.

1045
Living Room / Re: What is the most useless key on the keyboard
« on: February 10, 2007, 02:08 PM »
For me, the most useless (and also the most anoying) key in my keyboard is definitelly the 'insert' key. I always wondered why people invented that thing. I even removed it from my external keyboard, because i kept inadvertely pressing it, and overwriting stuff!

Heh, I can't live without Insert. Word has always had a fantastic feature which makes Insert work as Ctrl+V, ie Paste. It's much, much faster that way for me. I find Ctrl+Insert for Copy fast than Ctrl+C too, perhaps because I'm better at using my right hand.

I carried that over to some of the programs I've written, using Insert to mean "add new [thing]", where "thing" is whatever the program is designed to handle, e.g. add a new address in an addressbook, add a new password in a password manager, etc.

The upshot is, I cannot work with any of the newer keyboards where the insert/delete/home/end/pgup/pgdn keys are not arranged in two rows, 3+3. Any other layout and I'm helpless :)

Pages: prev1 ... 204 205 206 207 208 [209] 210 211 212 213next
Go to full version