title: How can I Prevent Shortcuts from Colliding/Interacting in Delphi?
body: <p>I use the standard Cut, Copy, Paste actions on my Main Menu. They have the shortcuts <kbd>Ctrl-X</kbd>, <kbd>Ctrl-C</kbd> and <kbd>Ctrl-V</kbd>.</p>
  
  <p>When I open a modal form, e.g. FindFilesForm.ShowModal, then all the shortcuts work from the form.</p>
  
  <p>But when I open a non-modal form, e.g. FindFilesForm.Show, then the shortcuts do not work.</p>
  
  <p>I would think that those actions should work if the FindFilesForm is the active form. It's modality should have nothing to do with it, or am I wrong in my thinking?</p>
  
  <p>Never-the-less, how can I get the shortcuts to work on a non-modal form?</p>
  
  <hr>
  
  <p>After Cary's response, I researched it further.  It is not a problem with certain controls, e.g. TMemo or TEdit.</p>
  
  <p>But it is for some others. Specifically, the ones where it happens include:</p>
  
  <ol>
  <li>the text in a TComboBox</li>
  <li>the text in a TFindDialog</li>
  <li>a TElTreeInplaceEdit control, part of LMD's ElPack</li>
  </ol>
  
  <p>I'll see if there are others and add them to the list.</p>
  
  <p>These are all on important Non-Modal forms in my program.</p>
  
  <p>So I still need a solution.</p>
  
  <hr>
  
  <p>Okay. I really need help with this. So this becomes the first question I am putting a bounty on.</p>
  
  <p>My discussion with Cary that takes place through his answer and the comments there describe my problem in more detail. </p>
  
  <p>And as I mentioned in one of those comments, a related problem seems to be discussed <a href="https://forums.codegear.com/thread.jspa?threadID=19946" rel="nofollow noreferrer">here.</a></p>
  
  <p>What I need is a solution or a workaround, that will allow the <kbd>Ctrl-X</kbd>, <kbd>Ctrl-C</kbd> and <kbd>Ctrl-V</kbd> to always work in a TComboBox and TFindDialog in a Non-Modal window. If those two get solved, I'm sure my TElTreeInplaceEdit will work as well.</p>
  
  <p>It takes only a couple of minutes to set up an simple test program as Cary describes. Hopefully someone will be able to solve this.</p>
  
  <p>Just be wary that there seems to be something that allows it to work sometimes but not work other times. If I can isolate that in more detail, I'll report it here.</p>
  
  <p>Thanks for any help you can offer me.</p>
  
  <hr>
  
  <p>Mghie worked very hard to find a solution, and his OnExecute handler combined with his ActionListUpdate handler do the trick. So for his effort, I'm giving him the accepted solution and the bounty points.</p>
  
  <p>But his actionlist update handler is not simple and you need to specify in it all the cases you want to handle. Let's say there's also <kbd>Ctrl+A</kbd> for select all or <kbd>Ctrl-Y</kbd> for undo you might want. A general procedure would be better.</p>
  
  <p>So if you do come across this question in your search for the answer, try first the answer I supplied that adds an IsShortcut handler. It worked for me and should handle every case and does not need the OnExecute handlers, so is much simpler. Peter Below wrote that code and Uwe Molzhan gets finders fee.</p>
  
  <p>Thanks Cary, mghie, Uwe and Peter for helping me solve this. Couldn't have done it without you. (Maybe I could have, but it might have taken me 6 months.)</p>