On_kp Event

Top  Previous  Next

Function:

Generated whenever a key transitions to another state.

Declaration:

on_kp(key_event as pl_kp_event_codes, key_code as byte)

See Also:

Servicing Keypad Events, 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). Bits 7-4 of this code represent scan line number, bits 3-0 -- return line number.

Details

Pressing and releasing any key on the keypad can generate up to five different events, as explained in Key States and Transitions. Scan lines and return lines are numbered as they are listed in kp.returnlinesmapping and kp.scanlinesmapping.

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