on key
Valid for: CANoe DE • CANoe:lite DE • CANoe4SW DE • CANoe4SW:lite DE Withon key procedure you can execute defined actions with a key press.
E.g. write
on key 'a'. The code for a key press can be entered either as a character, a number or a predefined identifier for function keys. The event procedure on key * reacts to all key presses.
In on key procedures the keyword this serves to determine the active key code. For example, if you wish to incorporate the handling of keyboard entries in an event procedure you could write it as the following code:
on key procedures on key 'a' and on key *, the procedure on key 'a' will be called up, when key ‘a’ is used. With all other keys the procedure on key * will be called up.
The keys <ESC>, <F7>, <F8> and <F9> are not supported of on key procedures.
In CAPL the different keys have to be called as follows:
- Key:
<F1>-<F12>(<F7>,<F8>and<F9>are not supported)- CAPL code:
F1 - F12
- CAPL code:
- Key:
<Shift>+<F1>-<Shift>+<F12>- CAPL code:
shiftF1 - shiftF12
- CAPL code:
- Key:
<Ctrl>+<F1>-<Ctrl>+<F12>- CAPL code:
ctrlF1 - ctrlF12
- CAPL code:
- Key:
<Ctrl>+<Page up>/<Ctrl>+<Page down>- CAPL code:
ctrlPageUp / ctrlPageDown
- CAPL code:
- Key:
<Page up>/<Page down>- CAPL code:
PageUp / PageDown
- CAPL code:
- Key:
<End>- CAPL code:
End
- CAPL code:
- Key:
<Home>- CAPL code:
Home
- CAPL code:
- Key:
<Insert>- CAPL code:
InsertKey
- CAPL code:
- Key:
<Delete>- CAPL code:
DeleteKey
- CAPL code:
- Key:
<Left Arrow>,<Right Arrow>,<Up Arrow>,<Down Arrow>- CAPL code:
CursorLeft, CursorRight, CursorUp, CursorDown
- CAPL code:
- Key:
<Ctrl>+<Left Arrow>,<Ctrl>+<Right Arrow>,<Ctrl>+<Up Arrow>,<Ctrl>+<Down Arrow>- CAPL code:
ctrlCursorLeft, ctrlCursorRight, ctrlCursorUp, ctrlCursorDown
- CAPL code:
- Code:
on key 'a'- Description: Reacts on pressing key ‘a’
- Code:
on key ' '- Description: Reacts on pressing the spacebar
- Code:
on key 0x20- Description: Reacts on pressing the spacebar
- Code:
on key F1- Description: Reacts on pressing
<F1>
- Description: Reacts on pressing
- Code:
on key shiftF3- Description: Reacts on pressing
<Shift>+<F3>
- Description: Reacts on pressing
- Code:
on key ctrlF12- Description: Reacts on pressing
<Ctrl>+<F12>
- Description: Reacts on pressing
- Code:
on key PageUp- Description: Reacts on pressing
<Page up>
- Description: Reacts on pressing
- Code:
on key ctrlPageDown- Description: Reacts on pressing
<Ctrl>+<Page down>
- Description: Reacts on pressing
- Code:
on key Home- Description: Reacts on pressing
<Home>
- Description: Reacts on pressing
- Code:
on key End- Description: Reacts on pressing
<End>
- Description: Reacts on pressing