Applies To:
  • CitectSCADA 5.20, 5.21, 5.30

Summary:
You cannot override (redefine) Keyboard Keys already defined in any included project. This also applies for The Citect Include project. Keyboard Commands cannot be overridden in projects that have duplicate keys defined.

CASE STUDY

This problem surfaced due to a requirement that a main project override keyboard commands in one of its included projects. It was required that the same key perform different actions whether an included project was run as a stand alone project or whether it was running as part of a main project higher in the hierarchy. The Client had keys and commands defined as follows:

Main Project:

Keyboard Key Definition:

Key Name: MENU_KEY

Key Code: KEY_F1

 

Keyboard Command Definition:

Key Sequence: MENU_KEY

Command: PageDisplay("Menu")

 

Included Project:

Keyboard Key Definition:

Key Name: HELP_KEY

Key Code: KEY_F1

 

Keyboard Command Definition:

Key Sequence: HELP_KEY

Command: PageDisplay("Help")

When the key sequence was typed in the Main Project at runtime it would perform the included project's definition.


Solution:
To override Keyboard Commands in Citect, ensure that its Key Name is defined once at the lowest level that it is required in the project hierarchy. From the case study above you would define the keyboard key as follows:

Lowest Included Project in Hierarchy:

Key Name: F1_KEY

Key Code: KEY_F1

Then in each respective project, define your keyboard commands based on the key sequence defined by that Key Name so that in the example above we would have:

Main Project:

Keyboard Command Definition:

Key Sequence: F1_KEY

Command: PageDisplay("Menu")

Included Project:

Keyboard Command Definition:

Key Sequence: F1_KEY

Command: PageDisplay("Help")

 

Keywords:
 

Attachments