Skip to main content
Open topic with navigation CAPL Functions » General » Function Overview » keypressed

keypressed

Valid for: CANoe DE • CANoe:lite DE • CANoe4SW DE • CANoe4SW:lite DE

Function Syntax

Description

This function returns the key code of a currently pressed key. If no key is being pressed it returns 0. For example, pressing of a key can be queried in a timer function. The reaction can also be to letting go of a key.

Parameters

Return Values

  • Key code of pressed key.
  • If the 8 lower bits do not equal 0, keypressed returns the ASCII code of the next key in the keyboard buffer. If the 8 lower bits do not equal 0, the 8 upper bits represent the extended key code (see IBM PC Technical Reference Manual).

Example