Code:
#include <windows.h>

LRESULT CALLBACK AcknexMsgLoop(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
LRESULT CALLBACK typewriter_msgLoop(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);

LRESULT CALLBACK typewriter_msgLoop(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	char c = (char)wParam;
	
	if (message == WM_CHAR)
	{
		if ((c > 31) && (c < 127)) 	
		{
			
			//do something useful
		}

		//backspace handling
		else if (c == 8)
		{
			//do something backspacy
		}
		//del handling
		else if (c == 127)
		{
			//delete something
		}

	}
	//engine message loop
	return AcknexMsgLoop(hwnd, message, wParam, lParam);       
}

void typewriter_startup()
{
	AcknexMsgLoop = on_message;
	on_message = typewriter_msgLoop;
}



A quick and dirty example. The numbers represent ASCII. (https://www.uni-due.de/hummell/infos/ascii/)

I have doubts whether this fixes the key mapping, though.