Dungeon Keeper Gold works in 2000,XP, 2003 32bit\64bit, XP 32\64bit.
ALL OS's require "Windows 95 Compatibility mode" to be applied.
Under 64bit OS's the installer will not work so you'll have to install the game on a 32bit OS and copy the files over.
Under Vista+ OS's you'll have to play the game in Vmware 6.5+ with Windows XP as a guest OS and you'll of course have to apply "Windows 95 Compatibility mode"
Your mouse\keyboard issue isn't a DK problem AFAIK. In the 10+ years I've played and tested DK I've never experienced it.
Assuming this is Dungeon Keeper Gold then all you need to do is apply Windows 95 compatibility mode to the D3D Windows shortcuts (Both DK and Deeper Dungeons) and the game will work fine.
If that doesn't work then a long time ago I had to do the below:
OLD INFO
Dungeon Keeper Gold Edition
To get D3D to work:
Upon running the game in D3D you will be dumped back to the desktop. Read the following to fix it.
Install the Application Compatibility Toolkit v1.5.
Use QfixApp on the game and click the "EmulateHeap" box.
Click the "Advanced" tab. Then click "Create attributes file".
Then go to the AppPatch folder in the Windows folder and click on the .reg
Now all you have to do is run the game and it will always run without having to do the above every time!
Reinstall this .reg if you reinstall windows!
If you do decide to play DK in DOSBox then you should definetly be using a CUE/BIN file if you want to hear the CD Audio tracks.
I believe I remember hearing of some AI issue with the DOS ver of DK though.