Navigation: Language Reference > 9 - Window and Report Attributes > Window and Report Attributes >====== KEY (set execution keycode) ====== | ![]() ![]() ![]() |
KEY(keycode)
KEY | Specifies a “hot” key for the control |
keycode | A Clarion Keycode or keycode equate label. |
The KEY attribute (PROP:KEY) specifies a “hot” key to immediately give focus to the control or execute the control's associated action.
The following controls receive focus: COMBO, CUSTOM, ENTRY, GROUP, LIST, OPTION, PROMPT, SPIN, TEXT.
The following controls both receive focus and immediately execute: BUTTON, CHECK, CUSTOM, RADIO, MENU, ITEM.
Example:
MainWin APPLICATION('My Application'),SYSTEM,MAX,ICON('MyIcon.ICO'),STATUS
MENUBAR
MENU('&Edit'),USE(?EditMenu)
ITEM('Cu&t'),USE(?CutText),KEY(CtrlX),STD(STD:Cut),DISABLE
ITEM('&Copy'),USE(?CopyText),KEY(CtrlC),STD(STD:Copy),DISABLE
ITEM('&Paste'),USE(?PasteText),KEY(CtrlV),STD(STD:Paste),DISABLE
END
END
TOOLBAR
COMBO(@S8),AT(120,120,20,20),USE(?C1),FROM(Q1:F2),KEY(F1Key)
LIST,AT(120,0,20,20),USE(?L1),FROM(Que1),KEY(F2Key)
SPIN(@N8.2),AT(280,0,20,20),USE(SpinVar1),FROM(Q),KEY(F3Key)
TEXT,AT(20,0,40,40),USE(E2),KEY(F4Key)
PROMPT('Enter &Data in E2:'),AT(10,200,20,20),USE(?P2),KEY(F5Key)
ENTRY(@S8),AT(100,200,20,20),USE(E2),KEY(F6Key)
BUTTON('&1'),AT(120,0,20,20),USE(?B7),KEY(F7Key)
CHECK('&A'),AT(0,120,20,20),USE(?C7),KEY(F8Key)
OPTION('Option'),USE(OptVar),KEY(F9Key)
RADIO('Radio 1'),AT(120,0,20,20),USE(?R1),KEY(F10Key)
RADIO('Radio 2'),AT(140,0,20,20),USE(?R2),KEY(F11Key)
END
END
END