For x3dom, you can disable the space bar and 'd' key and other key functionality for a more student friendly experience:
let scene = div
.append('x3d')
.attr('disableKeys', 'true')
.attr('width', scales.w.toString() + 'px')
.attr('height', scales.h.toString() + 'px')
.append('scene');
It appears that the disableKeys attribute can be only 'true' for 'false'. It'd be nice to be able to disable specific keys. I agree that some keys lead to rather surprising behavior, but I rather like having 'a' and 'r' handy.