Chosen Solution
Have done some digging online and although i have found several posts with the same issue nothing seems to be the exact same. basically the keyboard and mouse only work outside of the OSX. in other words it only works on initial boot prior to the apple chimes. they work in pre boot diagnostic, i can reset the pram. but as soon as the chimes have finished and the osx begins to load the keyboard and mouse suddenly turn off. when its loaded up be it in recovery, safe mode or normal mode the keyboard and mouse stop. but a usb keyboard and mouse work ok .
have you tried replacing the cable from the logic board to the trackpad? The keyboard is connected to the trackpad. So this cable might be causing issues.