GetKeyState is a Windows only function. Neither Lazarus nor FPC provide documentation for the API provided by the platform as that is handled by the OS providers (Microsoft with MSDN, Apple documentation, POSIX, etc.).
If you can't make use of existing cross platform functionality for your use case you'll need to research this for each platform separately. If you explain your needs the users here on the forum can likely help you find the right solution.