These events only works in the simulator:
When an arbitrary key is pressed or released in the simulator this function is called with event set to
kEventKeyPressed
orkEventKeyReleased
and the keycode of the key in the arg argument.
Someone said he wanted to port the Lua keyboard to C but not sure if it was released or not.
Edit: I was thinking about this post from @fzzr