Taking input from Keyboard during runtime : one of the possible solutions (DPI-C) does not work for me :(...! Any more solutions

The simulator is going to have the std input open for itself. You will need to open a file and read that instead of the keyboard.