@thehidden
The Member GetMem has made 2015 a demo for catching it, but this does not work with x64 compilation.
Did you try $MODE DELPHI? I cannot test now, I'm not in front of my computer.
Error Message with {$mode objfpc}
umain.pas(141,77) Error: Incompatible type for arg no. 2: Got "<address of function(LongInt;Int64;Int64):LongInt;StdCall>", expected "<procedure variable type of function(LongInt;Int64;Int64):Int64;StdCall>"
With {$mode delphi} it compiles completely but...
keyhook shows 0xc1 for return and enter
keypress does not show if return or enter is pressed and each new character has position 1 at line 1