Actually it deppends on what library are you using. The previous work for VCL, CLX and LCL, but SDL uses a different way, Allegro.pas another one, a "pure" console another...

Actually it would be different if you're using Delphi, Lazarus, "plain Free Pascal", GNU/Pascal, etc. And different Operating Systems... you know.