On_kp Event

Function:

When kp.genkpevent= 1- YES, this event is generated whenever a key transitions into a new state.

Declaration:

on_kp(key_event as pl_kp_event_codes, key_code as byte)

See Also:

Receiving Keypad Events Through On_kp Event, on_kp_overflow

Part

Description

key_event

0- PL_KP_EVENT_LONGRELEASED: The key has transitioned into the "longreleased" state.

1- PL_KP_EVENT_RELEASED: The key has transitioned into the "released" state.

2- PL_KP_EVENT_PRESSED: The key has transitioned into the "pressed" state.

3- PL_KP_EVENT_LONGPRESSED: The key has transitioned into the "longpressed" state.

4- PL_KP_EVENT_REPEATPRESSED: Auto-repeat for the key.

key_code

Key code (byte).

Details

Pressing and releasing any key on the keypad can generate up to five different events, as explained in Key States and Transitions .

This event can only be generated when the keypad is enabled (kp.enabled = 1- YES).

Another on_kp event is never generated until the previous one is processed (even though multiple keypad events may be waiting in the keypad event FIFO).