>Also, you might need to take account of the fact that a drag-and-drop operation fires MouseDown, but not Click (as Dan pointed out).
>Even if the application doesn't involve drag-and-drop, the user might conceivably still try to drag something, even though the app doesn't let them do so.
>The MouseDown would still fire in that case, so you might need to take action to inhibit the Click.
Completely correct, that's why you could really make use of the normal Click() event, instead of calling MyClick(). That's what I meant as I wrote "expand the idea to just store the modifier key state in MouseDown or KeyPress and then let the normal Click be the unified event". That means instead of calling MyClick you just let Keypress and Mousedown set TAg (or other dedicated properties) and evaluate these properties in the click. You might also store SECONDS() to make sure the Click() happens right after MouseDown or Keypress.
Today I really had to fiddle with these low level events in case of a barcode scanner with Postamble "ENTER", so after the 13 EAN digits the barcode scanner sends ENTER. Which is nice in a situation you have SET CONFIRM ON, but not in my situation, as I had set Textbox.MaxLength=13 and SET CONFIRM OFF, instead. This meant the ENTER was sent to the next control in tab order, and that caused a functionality which should be manuylla triggered by ENTER, or not, depending on what the user wants to select next. I stop explaining the workflow, that would only lead off topic.
Why I tell this: 1. I made use of the TAG, I did use Mousedown and Keypress here, to solve the problem and especially swalled the ENTER with NODEFAULT in the Keypress of the next control. On the other side: It will be vary hard to tell next month, why I did this. So you better document such codes and what they mean and what they do and why they are there.
"To keep a code safe under all circumstances." is a good reason, but I don't see how quering modifer keys in a click event helps keeping something safe. What keeps code safe is clean, lean code, you can easily maintain and oversee and know what it does why. So if you ask me for my overall recommendation: I would not implement the feature to consider modifier keys with clicks. Rather add more buttons or use dblclick and/or right click, context menus.
What a collegou from a different software company does and showed in a regular meeting we have every month is, to have some small "hot spot" buttons, which when clicked, reveal more options. A bit like a context menu does, but which user really does know and use context menus? And besides: How do you use a right click in a touch interface?
UX is a topic of it's own. I'm a bit turtured by a current project, because the workflow is designed so fully guides with disabling/enabling controls, setting automatic focus etc, that any error in the logic, or any circumstance like a barcode scanner postamble disturbs the process and causes extra cases to be considered, that it's hard to meet the mile stoenes. I would always suggest to not narrow down the user to what should be enabled/disabled in the current situation, but instead keep anything enabled and rather give users too much rights than too less (within the limitations, that make sense). Eg it is nice, if a save button only get's active, when there is a change to save, but it's a catastrophe, if the button never get's enabled, because of an error in the code detecting changes. So why not have the save button enabled anyway. My customer is wanting such or comparable things and I couldn't talk them out of it, it's in their mind. I know no application, that does disable a save toolbar button or menu item.
Agin in short: Don't do what needs special programming and can't be simply set with one or two properties. There are seldom expceptions to the rule: keep it simple. This is mant for both the user and the developer.
Bye, Olaf.