L-force | plc designer – Lenze PLC Designer PLC Designer (R3-1) User Manual

Page 213

Advertising
background image

L-force | PLC Designer

Visualization

DMS 4.1 EN 03/2011 TD29

211

Method HandleKeyEvent, assigned to POU:
The interface VisuElems.IVisuUserEventManager requires a method with the following
signature that will be called with all available information:

/// This method will be called after a key event is released.
/// RETURN:
/// TRUE - When the handler has handled this event and it should not be handled by
someone else
/// FALSE - When the event is not handled by this handler
METHOD HandleKeyEvent : BOOL
VAR_INPUT
/// Event type. The value is true if a key-up event was released.
bKeyUpEvent : BOOL;
/// Key code
dwKey : DWORD;
/// Modifiers. Possible values:
/// VISU_KEYMOD_SHIFT : DWORD := 1;
/// VISU_KEYMOD_ALT : DWORD := 2;
/// VISU_KEYMOD_CTRL : DWORD := 4;
dwModifiers : DWORD;
/// Pointer to the client structure were the event was released
pClient : POINTER TO VisuStructClientData;
END_VAR
VAR
END_VAR

PLC_PRG.stInfo := 'KeyEvent up: ';
PLC_PRG.stInfo := CONCAT(PLC_PRG.stInfo, BOOL_TO_STRING(bKeyUpEvent));
PLC_PRG.stInfo := CONCAT(PLC_PRG.stInfo, ', key: ');
PLC_PRG.stInfo := CONCAT(PLC_PRG.stInfo, DWORD_TO_STRING(dwKey));
PLC_PRG.stInfo := CONCAT(PLC_PRG.stInfo, ', modifier: ');
PLC_PRG.stInfo := CONCAT(PLC_PRG.stInfo, DWORD_TO_STRING(dwModifiers));
PLC_PRG.stInfo := CONCAT(PLC_PRG.stInfo, ', by: ');
PLC_PRG.stInfo := CONCAT(PLC_PRG.stInfo, SEL(pClient^.globaldata.clienttype =
VisuElems.Visu_ClientType.Targetvisualization, 'other visu', 'targetvisu'));

Advertising