Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to prevent shortcuts from firing when form is not active

Tags:

delphi

I open forms inside tabs of a page control. These forms may contain actions with shortcuts. And I want these shortcuts to be fired only when the tab that contain this form is active.

I tried to override form's IsShortCut but it's not called. Form's OnShortCut is not called either.

I would like to avoid putting code on each action to check this.

I'm using Delphi 2010.

like image 244
Erick Sasse Avatar asked Sep 17 '25 02:09

Erick Sasse


1 Answers

Set the State for the action lists on your hidden tabs to asSuspended. Only the action list on your visible tab should have a state of asNormal. That will prevent the shortcut keys from working. It also prevents those actions from updating, which may or may not be a good thing for your application.

like image 65
afrazier Avatar answered Sep 18 '25 15:09

afrazier