I assume you are talking about GUI programming?
This really depends on the platform you are running on. If you are programming a win32 application, inside the windowproc function you will provide a case WM_KEYDOWN.
There is also third party libraries you can use in order to make the program more portable. For example, QT is widely used and the code is reusable on windows / unix / linux (as long as the QT library is installed on that machine).
LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
// check the key code for the ctrl button against wParam
return DefWindowProc(hWnd, msg, wParam, lParam);
Also wxWidgets is a good one, which supports GDK, Windows and MacOS.